@mcp-b/react-components 0.11.0 → 0.13.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-Br6tKEl8.d.ts} +38 -10
- 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/{Button-Ct5I6aTu.d.ts → Button-FX_hpqxm.d.ts} +8 -11
- package/dist/{CodeBlock-XNQOupQ3.js → CodeBlock-BUFXG8HW.js} +22 -12
- package/dist/{CodeBlock-CxQXv3C4.d.ts → CodeBlock-DUh9WOGo.d.ts} +13 -7
- package/dist/{Combobox-D9anamNr.d.ts → Combobox-B9Fcd6q-.d.ts} +4 -14
- package/dist/{FileTree-wMyZhhHO.js → FileTree-mpEIcfzA.js} +1 -1
- package/dist/{Menu-B5vDqZe_.d.ts → Menu-Bgu-ufb5.d.ts} +29 -65
- package/dist/{ModelSelector-DXtpcRmT.js → ModelSelector-DVgVBdvw.js} +23 -20
- package/dist/{PromptInput-D6-G24p7.d.ts → PromptInput-p5KmOmt1.d.ts} +313 -89
- package/dist/Select-Dl_vF_Bt.d.ts +213 -0
- package/dist/{Tabs-D9EAq09D.d.ts → Tabs-3Zc4tb9D.d.ts} +9 -6
- package/dist/ThinkChat-7DQ2CogF.js +222 -0
- package/dist/{ThinkChatActivity-B2UD95My.d.ts → ThinkChatActivity-Cuk28Js_.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/{attachment-preview-ChtC3HiU.js → attachment-preview-DIs50Q0h.js} +3 -3
- package/dist/components/Accordion.d.ts +17 -6
- package/dist/components/Accordion.js +23 -36
- package/dist/components/Activity.d.ts +5 -5
- package/dist/components/Activity.js +9 -9
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/AgentChat.js +354 -132
- package/dist/components/AgentConnection.js +6 -22
- package/dist/components/AlertDialog.d.ts +40 -32
- package/dist/components/AlertDialog.js +46 -39
- package/dist/components/Artifact.d.ts +1 -1
- package/dist/components/Artifact.js +5 -5
- package/dist/components/Autocomplete.js +10 -2
- package/dist/components/Avatar.d.ts +2 -2
- package/dist/components/Avatar.js +3 -3
- package/dist/components/Badge.d.ts +11 -14
- package/dist/components/Badge.js +11 -33
- package/dist/components/BrowserLiveView.d.ts +1 -1
- package/dist/components/BrowserLiveView.js +39 -45
- package/dist/components/BrowserReplay.d.ts +1 -1
- package/dist/components/BrowserReplay.js +4 -4
- package/dist/components/BrowserRunPanel.js +91 -55
- package/dist/components/Button.d.ts +2 -2
- package/dist/components/Button.js +7 -30
- package/dist/components/ChainOfThought.d.ts +5 -5
- package/dist/components/ChainOfThought.js +8 -5
- package/dist/components/ChatGptSignInScreen.js +3 -3
- package/dist/components/Checkbox.d.ts +10 -2
- package/dist/components/Checkbox.js +13 -6
- package/dist/components/CheckboxGroup.d.ts +6 -6
- package/dist/components/CheckboxGroup.js +6 -6
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.d.ts +58 -0
- package/dist/components/CodexModelSelector.js +170 -0
- package/dist/components/Collapsible.d.ts +2 -4
- package/dist/components/Collapsible.js +9 -7
- package/dist/components/Combobox.d.ts +2 -2
- package/dist/components/Combobox.js +20 -22
- package/dist/components/Commit.d.ts +6 -6
- package/dist/components/Commit.js +14 -26
- package/dist/components/Context.js +5 -1
- package/dist/components/ContextMenu.d.ts +20 -72
- package/dist/components/ContextMenu.js +46 -56
- package/dist/components/Conversation.d.ts +3 -7
- package/dist/components/Conversation.js +3 -4
- package/dist/components/Dialog.d.ts +38 -30
- package/dist/components/Dialog.js +46 -34
- package/dist/components/EnvironmentVariables.d.ts +2 -7
- package/dist/components/EnvironmentVariables.js +13 -36
- package/dist/components/Field.d.ts +3 -3
- package/dist/components/Field.js +7 -8
- package/dist/components/Fieldset.d.ts +2 -2
- package/dist/components/Fieldset.js +2 -2
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Label.d.ts +1 -1
- package/dist/components/Label.js +1 -1
- package/dist/components/Marker.js +1 -15
- package/dist/components/McpServerPicker.d.ts +31 -6
- package/dist/components/McpServerPicker.js +136 -72
- package/dist/components/Menu.d.ts +2 -2
- package/dist/components/Menu.js +41 -51
- package/dist/components/Menubar.d.ts +16 -52
- package/dist/components/Menubar.js +44 -56
- package/dist/components/Message.d.ts +4 -3
- package/dist/components/Message.js +16 -9
- package/dist/components/MessageScroller.d.ts +1 -1
- package/dist/components/MessageScroller.js +1 -1
- package/dist/components/Meter.js +5 -0
- package/dist/components/ModelSelector.d.ts +12 -9
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.d.ts +3 -14
- package/dist/components/NavigationMenu.js +22 -38
- package/dist/components/NumberField.js +6 -0
- package/dist/components/Popover.d.ts +21 -44
- package/dist/components/Popover.js +33 -23
- package/dist/components/PreviewCard.d.ts +20 -18
- package/dist/components/PreviewCard.js +30 -20
- package/dist/components/PricingPage.js +30 -29
- package/dist/components/Progress.d.ts +7 -3
- package/dist/components/Progress.js +9 -4
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +184 -148
- package/dist/components/Queue.d.ts +8 -19
- package/dist/components/Queue.js +6 -6
- package/dist/components/RadioGroup.d.ts +10 -9
- package/dist/components/RadioGroup.js +8 -9
- package/dist/components/Reasoning.d.ts +4 -4
- package/dist/components/Reasoning.js +12 -21
- package/dist/components/ScrollArea.d.ts +2 -9
- package/dist/components/ScrollArea.js +5 -23
- package/dist/components/Select.d.ts +2 -2
- package/dist/components/Select.js +100 -134
- package/dist/components/Slider.d.ts +10 -7
- package/dist/components/Slider.js +12 -11
- package/dist/components/Sources.d.ts +4 -4
- package/dist/components/Sources.js +8 -5
- package/dist/components/Stepper.js +2 -8
- package/dist/components/Switch.d.ts +6 -3
- package/dist/components/Switch.js +7 -4
- package/dist/components/Tabs.d.ts +2 -2
- package/dist/components/Tabs.js +9 -4
- package/dist/components/Task.d.ts +4 -4
- package/dist/components/Task.js +10 -6
- package/dist/components/Terminal.d.ts +2 -2
- package/dist/components/Terminal.js +5 -5
- package/dist/components/TestResults.d.ts +4 -4
- package/dist/components/TestResults.js +5 -5
- package/dist/components/ThinkChat.d.ts +37 -30
- package/dist/components/ThinkChat.js +1 -152
- package/dist/components/ThinkChatActivity.d.ts +2 -2
- package/dist/components/ThinkChatActivity.js +4 -11
- 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 +27 -15
- 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 +35 -25
- 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/Toast.js +7 -0
- package/dist/components/ToggleGroup.d.ts +6 -2
- package/dist/components/ToggleGroup.js +6 -2
- package/dist/components/Toolbar.js +6 -0
- package/dist/components/Tooltip.d.ts +36 -27
- package/dist/components/Tooltip.js +45 -29
- package/dist/components/WebPreview.d.ts +1 -1
- package/dist/components/WebPreview.js +3 -3
- package/dist/components/WorkspaceExplorer.d.ts +6 -8
- package/dist/components/WorkspaceExplorer.js +9 -7
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-C6JSKtFE.js → copy-button-DUMLYdsk.js} +7 -6
- package/dist/{copy-button-BKXqGiNm.d.ts → copy-button-DtPMgN7e.d.ts} +3 -2
- package/dist/icons-Ba9THQKz.js +64 -0
- package/dist/icons-CUCz_Sft.d.ts +210 -0
- package/dist/merge-refs-DF_7w2x_.js +18 -0
- package/dist/styles/accessibility.css +14 -0
- package/dist/styles/accordion.css +21 -61
- package/dist/styles/activity.css +23 -58
- package/dist/styles/agent-chat.css +49 -5
- package/dist/styles/agent-connection.css +8 -10
- package/dist/styles/alert-dialog.css +20 -26
- package/dist/styles/artifact.css +6 -6
- package/dist/styles/attachment-preview.css +1 -1
- package/dist/styles/autocomplete.css +5 -170
- package/dist/styles/avatar.css +8 -8
- package/dist/styles/badge.css +8 -10
- package/dist/styles/base-ui-motion.css +176 -0
- package/dist/styles/base.css +19 -25
- package/dist/styles/browser-live-view.css +7 -7
- package/dist/styles/browser-replay.css +5 -5
- package/dist/styles/browser-run-panel.css +59 -112
- package/dist/styles/button.css +48 -43
- package/dist/styles/card.css +3 -5
- package/dist/styles/chain-of-thought.css +14 -70
- package/dist/styles/chatgpt-sign-in-screen.css +3 -3
- package/dist/styles/checkbox-group.css +1 -1
- package/dist/styles/checkbox.css +3 -7
- package/dist/styles/code-block.css +10 -10
- package/dist/styles/codex-model-selector.css +186 -0
- package/dist/styles/collapsible.css +11 -27
- package/dist/styles/combobox.css +3 -149
- package/dist/styles/commit.css +19 -35
- package/dist/styles/context-menu.css +1 -77
- package/dist/styles/context.css +12 -12
- package/dist/styles/conversation.css +7 -7
- package/dist/styles/dialog.css +34 -55
- package/dist/styles/environment-variables.css +10 -10
- package/dist/styles/field.css +16 -58
- package/dist/styles/fieldset.css +2 -2
- package/dist/styles/file-tree.css +7 -9
- package/dist/styles/index.css +12 -2
- package/dist/styles/input.css +1 -51
- package/dist/styles/label.css +2 -2
- package/dist/styles/marker.css +2 -4
- package/dist/styles/mcp-server-picker.css +66 -19
- package/dist/styles/menu.css +6 -153
- package/dist/styles/menubar.css +6 -105
- package/dist/styles/message-scroller.css +1 -1
- package/dist/styles/message.css +87 -9
- package/dist/styles/meter.css +4 -20
- package/dist/styles/model-selector.css +32 -20
- package/dist/styles/navigation-menu.css +14 -54
- package/dist/styles/number-field.css +8 -23
- package/dist/styles/popover.css +13 -68
- package/dist/styles/preview-card.css +5 -46
- package/dist/styles/pricing-page.css +43 -43
- package/dist/styles/progress.css +7 -16
- package/dist/styles/prompt-input.css +100 -44
- package/dist/styles/queue.css +12 -28
- package/dist/styles/radio.css +4 -8
- package/dist/styles/reasoning.css +3 -62
- package/dist/styles/recipes.css +475 -0
- package/dist/styles/select.css +7 -103
- package/dist/styles/shell.css +3 -3
- package/dist/styles/slider.css +5 -7
- package/dist/styles/sources.css +9 -66
- package/dist/styles/stepper.css +16 -14
- package/dist/styles/streamdown.css +11 -57
- package/dist/styles/switch.css +4 -7
- package/dist/styles/tabs.css +7 -8
- package/dist/styles/task.css +13 -42
- package/dist/styles/terminal.css +7 -7
- package/dist/styles/test-results.css +21 -37
- package/dist/styles/think-execution-workbench.css +337 -0
- package/dist/styles/think-full-app.css +27 -410
- package/dist/styles/think-resize-handle.css +33 -0
- package/dist/styles/think-thread-picker.css +18 -247
- package/dist/styles/think-thread-shell.css +219 -0
- package/dist/styles/toast.css +14 -25
- package/dist/styles/toggle-group.css +16 -14
- package/dist/styles/toggle.css +14 -15
- package/dist/styles/toolbar.css +13 -25
- package/dist/styles/tooltip.css +6 -16
- package/dist/styles/web-preview.css +15 -15
- package/dist/styles/workspace-explorer.css +21 -14
- package/dist/summarize-tool-input-BUJsENSn.js +12 -0
- package/dist/utils/codex-model-catalog.d.ts +142 -0
- package/dist/utils/codex-model-catalog.js +112 -0
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +8 -2
- package/dist/Select-CRsKCJ9x.d.ts +0 -200
- package/dist/ThinkChatContext-BLAAb8J5.d.ts +0 -28
- package/dist/components/McpServerConnections.d.ts +0 -41
- package/dist/components/McpServerConnections.js +0 -188
- package/dist/components/useStickToBottom.d.ts +0 -33
- package/dist/components/useStickToBottom.js +0 -107
- package/dist/icons-CbjtbIJK.d.ts +0 -51
- package/dist/icons-D2Q5n5C1.js +0 -291
- package/dist/styles/mcp-server-connections.css +0 -145
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { D as PencilIcon, F as StopIcon, L as WarningIcon, N as SpinnerIcon, P as SquareIcon, S as MicrophoneIcon, T as PaperclipIcon, h as FileIcon, i as ArrowUpIcon, k as PlusIcon, o as ChevronDownIcon, w as MonitorIcon, z as XIcon } from "../icons-Ba9THQKz.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
|
-
import { Tooltip
|
|
5
|
-
import { t as AttachmentPreview } from "../attachment-preview-
|
|
6
|
-
import { Combobox
|
|
7
|
-
import {
|
|
8
|
-
import { Select
|
|
9
|
-
import {
|
|
4
|
+
import { Tooltip } from "./Tooltip.js";
|
|
5
|
+
import { t as AttachmentPreview } from "../attachment-preview-DIs50Q0h.js";
|
|
6
|
+
import { Combobox } from "./Combobox.js";
|
|
7
|
+
import { Menu } from "./Menu.js";
|
|
8
|
+
import { Select } from "./Select.js";
|
|
9
|
+
import { Tabs } from "./Tabs.js";
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { getToolApproval, getToolInput, getToolOutput } from "@cloudflare/think/react";
|
|
13
13
|
import { getToolName, isToolUIPart } from "ai";
|
|
14
14
|
//#region src/components/PromptInput.tsx
|
|
15
|
-
const PromptInputContext = React.createContext(null);
|
|
16
15
|
const PromptInputController = React.createContext(null);
|
|
17
|
-
const ProviderAttachmentsContext = React.createContext(null);
|
|
18
16
|
const LocalAttachmentsContext = React.createContext(null);
|
|
19
|
-
const LocalReferencedSourcesContext = React.createContext(null);
|
|
20
|
-
function usePromptInputContext(component) {
|
|
21
|
-
const ctx = React.useContext(PromptInputContext);
|
|
22
|
-
if (!ctx) throw new Error(`${component} must be used inside a <PromptInput>.`);
|
|
23
|
-
return ctx;
|
|
24
|
-
}
|
|
25
17
|
function usePromptInputController() {
|
|
26
18
|
const ctx = React.useContext(PromptInputController);
|
|
27
19
|
if (!ctx) throw new Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");
|
|
@@ -31,24 +23,16 @@ function useOptionalPromptInputController() {
|
|
|
31
23
|
return React.useContext(PromptInputController);
|
|
32
24
|
}
|
|
33
25
|
function useProviderAttachments() {
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
function useOptionalProviderAttachments() {
|
|
39
|
-
return React.useContext(ProviderAttachmentsContext);
|
|
26
|
+
const controller = useOptionalPromptInputController();
|
|
27
|
+
if (!controller) throw new Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");
|
|
28
|
+
return controller.attachments;
|
|
40
29
|
}
|
|
41
30
|
function usePromptInputAttachments() {
|
|
42
|
-
const
|
|
43
|
-
const context = React.useContext(LocalAttachmentsContext) ??
|
|
31
|
+
const controller = useOptionalPromptInputController();
|
|
32
|
+
const context = React.useContext(LocalAttachmentsContext) ?? controller?.attachments;
|
|
44
33
|
if (!context) throw new Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider.");
|
|
45
34
|
return context;
|
|
46
35
|
}
|
|
47
|
-
function usePromptInputReferencedSources() {
|
|
48
|
-
const ctx = React.useContext(LocalReferencedSourcesContext);
|
|
49
|
-
if (!ctx) throw new Error("usePromptInputReferencedSources must be used within a PromptInput.");
|
|
50
|
-
return ctx;
|
|
51
|
-
}
|
|
52
36
|
function PromptInputProvider({ initialInput = "", children }) {
|
|
53
37
|
const [textInput, setTextInput] = React.useState(initialInput);
|
|
54
38
|
const [attachmentFiles, setAttachmentFiles] = React.useState([]);
|
|
@@ -103,10 +87,7 @@ function PromptInputProvider({ initialInput = "", children }) {
|
|
|
103
87
|
}), [attachments, textInput]);
|
|
104
88
|
return /* @__PURE__ */ jsx(PromptInputController.Provider, {
|
|
105
89
|
value: controller,
|
|
106
|
-
children
|
|
107
|
-
value: attachments,
|
|
108
|
-
children
|
|
109
|
-
})
|
|
90
|
+
children
|
|
110
91
|
});
|
|
111
92
|
}
|
|
112
93
|
/**
|
|
@@ -116,8 +97,8 @@ function PromptInputProvider({ initialInput = "", children }) {
|
|
|
116
97
|
*
|
|
117
98
|
* Use for assistant/chat submit forms. Do not use it as a generic textarea or
|
|
118
99
|
* non-chat form. Sigvelo changes: uses shared Menu, Select, Combobox, Tabs,
|
|
119
|
-
* Button, and Tooltip components; maps styles to CSS tokens; adds local
|
|
120
|
-
* attachment
|
|
100
|
+
* Button, and Tooltip components; maps styles to CSS tokens; and adds local
|
|
101
|
+
* attachment helpers.
|
|
121
102
|
*
|
|
122
103
|
* The form handles Enter-to-submit while multiline editing remains in the
|
|
123
104
|
* textarea. Attachment controls need accessible labels through their buttons
|
|
@@ -140,15 +121,12 @@ function PromptInputProvider({ initialInput = "", children }) {
|
|
|
140
121
|
*
|
|
141
122
|
* @see {@link https://elements.ai-sdk.dev/components/prompt-input | AI Elements Prompt Input}
|
|
142
123
|
*/
|
|
143
|
-
function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput, maxFiles, maxFileSize, onError, onSubmit, children,
|
|
144
|
-
const generatedId = React.useId();
|
|
145
|
-
const formId = id ?? generatedId;
|
|
124
|
+
function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput, maxFiles, maxFileSize, onError, onSubmit, children, ref, ...props }) {
|
|
146
125
|
const controller = useOptionalPromptInputController();
|
|
147
126
|
const usingProvider = Boolean(controller);
|
|
148
127
|
const formRef = React.useRef(null);
|
|
149
128
|
const inputRef = React.useRef(null);
|
|
150
129
|
const [localFiles, setLocalFiles] = React.useState([]);
|
|
151
|
-
const [referencedSources, setReferencedSources] = React.useState([]);
|
|
152
130
|
const files = controller?.attachments.files ?? localFiles;
|
|
153
131
|
const filesRef = React.useRef(files);
|
|
154
132
|
filesRef.current = files;
|
|
@@ -215,11 +193,6 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
215
193
|
return [];
|
|
216
194
|
});
|
|
217
195
|
}, [controller]);
|
|
218
|
-
const clearReferencedSources = React.useCallback(() => setReferencedSources([]), []);
|
|
219
|
-
const clear = React.useCallback(() => {
|
|
220
|
-
clearAttachments();
|
|
221
|
-
clearReferencedSources();
|
|
222
|
-
}, [clearAttachments, clearReferencedSources]);
|
|
223
196
|
const openFileDialog = React.useCallback(() => inputRef.current?.click(), []);
|
|
224
197
|
React.useEffect(() => {
|
|
225
198
|
if (!controller) return;
|
|
@@ -261,25 +234,6 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
261
234
|
openFileDialog,
|
|
262
235
|
remove
|
|
263
236
|
]);
|
|
264
|
-
const referencedSourcesCtx = React.useMemo(() => ({
|
|
265
|
-
add: (incoming) => {
|
|
266
|
-
const array = Array.isArray(incoming) ? incoming : [incoming];
|
|
267
|
-
setReferencedSources((prev) => [...prev, ...array.map((source) => ({
|
|
268
|
-
...source,
|
|
269
|
-
id: source.id ?? createId()
|
|
270
|
-
}))]);
|
|
271
|
-
},
|
|
272
|
-
clear: clearReferencedSources,
|
|
273
|
-
remove: (sourceId) => setReferencedSources((prev) => prev.filter((source) => source.id !== sourceId)),
|
|
274
|
-
sources: referencedSources
|
|
275
|
-
}), [clearReferencedSources, referencedSources]);
|
|
276
|
-
const submit = React.useCallback(() => {
|
|
277
|
-
formRef.current?.requestSubmit();
|
|
278
|
-
}, []);
|
|
279
|
-
const ctx = React.useMemo(() => ({
|
|
280
|
-
formId,
|
|
281
|
-
submit
|
|
282
|
-
}), [formId, submit]);
|
|
283
237
|
const handleSubmit = React.useCallback(async (event) => {
|
|
284
238
|
event.preventDefault();
|
|
285
239
|
const textarea = event.currentTarget.querySelector("textarea[data-prompt-input-textarea=\"true\"]");
|
|
@@ -295,42 +249,35 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
295
249
|
textarea.dispatchEvent(new Event("input", { bubbles: true }));
|
|
296
250
|
}
|
|
297
251
|
controller?.textInput.clear();
|
|
298
|
-
|
|
252
|
+
clearAttachments();
|
|
299
253
|
} catch {}
|
|
300
254
|
}, [
|
|
301
|
-
|
|
255
|
+
clearAttachments,
|
|
302
256
|
controller,
|
|
303
257
|
files,
|
|
304
258
|
onSubmit
|
|
305
259
|
]);
|
|
306
|
-
return /* @__PURE__ */
|
|
307
|
-
value:
|
|
308
|
-
children: /* @__PURE__ */ jsx(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
className: cx("prompt-input", className),
|
|
328
|
-
onSubmit: handleSubmit,
|
|
329
|
-
...props,
|
|
330
|
-
children
|
|
331
|
-
})]
|
|
332
|
-
})
|
|
333
|
-
})
|
|
260
|
+
return /* @__PURE__ */ jsxs(LocalAttachmentsContext.Provider, {
|
|
261
|
+
value: attachmentsCtx,
|
|
262
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
263
|
+
ref: inputRef,
|
|
264
|
+
accept,
|
|
265
|
+
"aria-label": "Upload files",
|
|
266
|
+
className: "prompt-input__file-input",
|
|
267
|
+
multiple,
|
|
268
|
+
onChange: (event) => {
|
|
269
|
+
if (event.currentTarget.files?.length) add(event.currentTarget.files);
|
|
270
|
+
event.currentTarget.value = "";
|
|
271
|
+
},
|
|
272
|
+
tabIndex: -1,
|
|
273
|
+
type: "file"
|
|
274
|
+
}), /* @__PURE__ */ jsx("form", {
|
|
275
|
+
ref: formRef,
|
|
276
|
+
className: cx("prompt-input", className),
|
|
277
|
+
onSubmit: handleSubmit,
|
|
278
|
+
...props,
|
|
279
|
+
children
|
|
280
|
+
})]
|
|
334
281
|
});
|
|
335
282
|
}
|
|
336
283
|
function PromptInputHeader({ className, children, ref, ...props }) {
|
|
@@ -421,7 +368,6 @@ function PromptInputTools({ className, children, ref, ...props }) {
|
|
|
421
368
|
const MIN_TEXTAREA_HEIGHT_PX = 24;
|
|
422
369
|
const MAX_TEXTAREA_HEIGHT_PX = 240;
|
|
423
370
|
function PromptInputTextarea({ className, placeholder = "How can I help?", rows = 1, minHeight = MIN_TEXTAREA_HEIGHT_PX, maxHeight = MAX_TEXTAREA_HEIGHT_PX, onChange, onCompositionEnd, onCompositionStart, onKeyDown, onInput, onPaste, ref, ...props }) {
|
|
424
|
-
const { submit } = usePromptInputContext("PromptInputTextarea");
|
|
425
371
|
const controller = useOptionalPromptInputController();
|
|
426
372
|
const attachments = usePromptInputAttachments();
|
|
427
373
|
const innerRef = React.useRef(null);
|
|
@@ -470,7 +416,7 @@ function PromptInputTextarea({ className, placeholder = "How can I help?", rows
|
|
|
470
416
|
if (event.defaultPrevented) return;
|
|
471
417
|
if (event.key === "Enter" && !event.shiftKey && !isComposing && !event.nativeEvent.isComposing) {
|
|
472
418
|
event.preventDefault();
|
|
473
|
-
|
|
419
|
+
event.currentTarget.form?.requestSubmit();
|
|
474
420
|
}
|
|
475
421
|
if (event.key === "Backspace" && event.currentTarget.value === "" && attachments.files.length > 0) {
|
|
476
422
|
event.preventDefault();
|
|
@@ -516,10 +462,10 @@ function PromptInputButton({ className, tooltip, variant = "ghost", color = "neu
|
|
|
516
462
|
children
|
|
517
463
|
});
|
|
518
464
|
if (!tooltipConfig) return button;
|
|
519
|
-
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(
|
|
465
|
+
return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: button }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
520
466
|
side: tooltipConfig.side,
|
|
521
467
|
sideOffset: 6,
|
|
522
|
-
children: /* @__PURE__ */ jsxs(
|
|
468
|
+
children: /* @__PURE__ */ jsxs(Tooltip.Popup, { children: [/* @__PURE__ */ jsx("span", {
|
|
523
469
|
className: "prompt-input__tooltip-content",
|
|
524
470
|
children: tooltipConfig.content
|
|
525
471
|
}), tooltipConfig.shortcut ? /* @__PURE__ */ jsx("kbd", {
|
|
@@ -528,25 +474,118 @@ function PromptInputButton({ className, tooltip, variant = "ghost", color = "neu
|
|
|
528
474
|
}) : null] })
|
|
529
475
|
}) })] });
|
|
530
476
|
}
|
|
477
|
+
/**
|
|
478
|
+
* Voice-dictation control for PromptInput. Final upstream transcripts are
|
|
479
|
+
* appended to the composer while interim text remains ephemeral.
|
|
480
|
+
*/
|
|
481
|
+
function PromptInputDictation({ voice, className, disabled, ref, ...props }) {
|
|
482
|
+
const controller = useOptionalPromptInputController();
|
|
483
|
+
const buttonRef = React.useRef(null);
|
|
484
|
+
const committedTranscriptRef = React.useRef("");
|
|
485
|
+
const [isStarting, setIsStarting] = React.useState(false);
|
|
486
|
+
const [startError, setStartError] = React.useState(null);
|
|
487
|
+
React.useImperativeHandle(ref, () => buttonRef.current, []);
|
|
488
|
+
React.useEffect(() => {
|
|
489
|
+
const transcript = voice.transcript;
|
|
490
|
+
if (!transcript) return;
|
|
491
|
+
const previous = committedTranscriptRef.current;
|
|
492
|
+
const addition = transcript.startsWith(previous) ? transcript.slice(previous.length).trim() : transcript.trim();
|
|
493
|
+
committedTranscriptRef.current = transcript;
|
|
494
|
+
if (!addition) return;
|
|
495
|
+
if (controller) {
|
|
496
|
+
controller.textInput.setInput(appendDictationTranscript(controller.textInput.value, addition));
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
const textarea = buttonRef.current?.form?.querySelector("textarea[data-prompt-input-textarea=\"true\"]");
|
|
500
|
+
if (!textarea) return;
|
|
501
|
+
textarea.value = appendDictationTranscript(textarea.value, addition);
|
|
502
|
+
textarea.dispatchEvent(new Event("input", { bubbles: true }));
|
|
503
|
+
}, [controller, voice.transcript]);
|
|
504
|
+
const error = startError ?? voice.error;
|
|
505
|
+
const listening = voice.isListening;
|
|
506
|
+
const label = listening ? "Stop dictation" : error ? "Retry dictation" : "Start dictation";
|
|
507
|
+
const status = error ? `Dictation failed: ${error}` : listening ? voice.interimTranscript ? "Listening. Speech detected." : "Listening for speech." : isStarting ? "Starting dictation." : "";
|
|
508
|
+
const level = Math.min(Math.max(voice.audioLevel, 0), 1);
|
|
509
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PromptInputButton, {
|
|
510
|
+
ref: buttonRef,
|
|
511
|
+
className: cx("prompt-input__dictation", className),
|
|
512
|
+
tooltip: {
|
|
513
|
+
content: label,
|
|
514
|
+
side: "top"
|
|
515
|
+
},
|
|
516
|
+
"aria-label": label,
|
|
517
|
+
"aria-pressed": listening,
|
|
518
|
+
"data-error": error ? "true" : void 0,
|
|
519
|
+
"data-listening": listening ? "true" : void 0,
|
|
520
|
+
"data-starting": isStarting ? "true" : void 0,
|
|
521
|
+
disabled: disabled || isStarting,
|
|
522
|
+
onClick: () => {
|
|
523
|
+
setStartError(null);
|
|
524
|
+
if (listening) {
|
|
525
|
+
voice.stop();
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
setIsStarting(true);
|
|
529
|
+
voice.start().catch((reason) => {
|
|
530
|
+
setStartError(reason instanceof Error ? reason.message : String(reason));
|
|
531
|
+
}).finally(() => setIsStarting(false));
|
|
532
|
+
},
|
|
533
|
+
...props,
|
|
534
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
535
|
+
className: "prompt-input__dictation-icon",
|
|
536
|
+
style: { "--prompt-input-dictation-level": level },
|
|
537
|
+
"aria-hidden": "true",
|
|
538
|
+
children: isStarting ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : listening ? /* @__PURE__ */ jsx(StopIcon, {}) : /* @__PURE__ */ jsx(MicrophoneIcon, {})
|
|
539
|
+
})
|
|
540
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
541
|
+
className: "prompt-input__dictation-status",
|
|
542
|
+
role: "status",
|
|
543
|
+
"aria-live": "polite",
|
|
544
|
+
"aria-atomic": "true",
|
|
545
|
+
children: status
|
|
546
|
+
})] });
|
|
547
|
+
}
|
|
548
|
+
function appendDictationTranscript(current, transcript) {
|
|
549
|
+
if (!current) return transcript;
|
|
550
|
+
return `${current}${/\s$/u.test(current) ? "" : " "}${transcript}`;
|
|
551
|
+
}
|
|
531
552
|
function PromptInputActionMenu(props) {
|
|
532
|
-
return /* @__PURE__ */ jsx(
|
|
553
|
+
return /* @__PURE__ */ jsx(Menu.Root, { ...props });
|
|
533
554
|
}
|
|
534
555
|
function PromptInputActionMenuTrigger({ className, children, ...props }) {
|
|
535
|
-
return /* @__PURE__ */ jsx(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
return /* @__PURE__ */ jsx(MenuContent, {
|
|
543
|
-
className: cx("prompt-input__action-menu", className),
|
|
544
|
-
...props,
|
|
545
|
-
children
|
|
556
|
+
return /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
557
|
+
unstyled: true,
|
|
558
|
+
render: /* @__PURE__ */ jsx(PromptInputButton, {
|
|
559
|
+
className: cx("prompt-input__action-menu-trigger", className),
|
|
560
|
+
...props,
|
|
561
|
+
children: children ?? /* @__PURE__ */ jsx(PlusIcon, {})
|
|
562
|
+
})
|
|
546
563
|
});
|
|
547
564
|
}
|
|
565
|
+
function PromptInputActionMenuContent({ anchor, positionMethod, side, sideOffset = 4, align, alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, children, tabIndex = 0, ...props }) {
|
|
566
|
+
return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
567
|
+
anchor,
|
|
568
|
+
positionMethod,
|
|
569
|
+
side,
|
|
570
|
+
sideOffset,
|
|
571
|
+
align,
|
|
572
|
+
alignOffset,
|
|
573
|
+
collisionBoundary,
|
|
574
|
+
collisionPadding,
|
|
575
|
+
sticky,
|
|
576
|
+
arrowPadding,
|
|
577
|
+
disableAnchorTracking,
|
|
578
|
+
collisionAvoidance,
|
|
579
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
580
|
+
tabIndex,
|
|
581
|
+
className: cx("prompt-input__action-menu", className),
|
|
582
|
+
...props,
|
|
583
|
+
children
|
|
584
|
+
})
|
|
585
|
+
}) });
|
|
586
|
+
}
|
|
548
587
|
function PromptInputActionMenuItem({ className, ...props }) {
|
|
549
|
-
return /* @__PURE__ */ jsx(
|
|
588
|
+
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
550
589
|
className: cx("prompt-input__action-menu-item", className),
|
|
551
590
|
...props
|
|
552
591
|
});
|
|
@@ -595,28 +634,32 @@ const PERMISSION_MODES = [{
|
|
|
595
634
|
* whoever owns the approvals (`AgentChat` wires both ends).
|
|
596
635
|
*/
|
|
597
636
|
function PromptInputPermissionSelector({ value, onValueChange, question = "How should agent actions be approved?" }) {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
"
|
|
608
|
-
children:
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
637
|
+
const selected = PERMISSION_MODES.find((mode) => mode.value === value) ?? PERMISSION_MODES[0];
|
|
638
|
+
return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(Menu.Trigger, {
|
|
639
|
+
unstyled: true,
|
|
640
|
+
render: /* @__PURE__ */ jsxs(PromptInputButton, {
|
|
641
|
+
size: "xs",
|
|
642
|
+
className: "prompt-input__permissions-trigger",
|
|
643
|
+
"data-mode": value,
|
|
644
|
+
"aria-label": selected.label,
|
|
645
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
646
|
+
className: "prompt-input__permissions-current",
|
|
647
|
+
children: PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsxs("span", {
|
|
648
|
+
className: "prompt-input__permissions-current-option",
|
|
649
|
+
"data-active": mode.value === value || void 0,
|
|
650
|
+
children: [mode.value === "bypass" ? /* @__PURE__ */ jsx(WarningIcon, { size: 14 }) : null, mode.label]
|
|
651
|
+
}, mode.value))
|
|
652
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, { size: 12 })]
|
|
653
|
+
})
|
|
654
|
+
}), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsxs(Menu.Popup, {
|
|
612
655
|
className: "prompt-input__permissions-menu",
|
|
613
656
|
children: [/* @__PURE__ */ jsx("div", {
|
|
614
657
|
className: "prompt-input__permissions-question",
|
|
615
658
|
children: question
|
|
616
|
-
}), /* @__PURE__ */ jsx(
|
|
659
|
+
}), /* @__PURE__ */ jsx(Menu.RadioGroup, {
|
|
617
660
|
value,
|
|
618
661
|
onValueChange: (mode) => onValueChange(mode),
|
|
619
|
-
children: PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsxs(
|
|
662
|
+
children: PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
620
663
|
value: mode.value,
|
|
621
664
|
closeOnClick: true,
|
|
622
665
|
className: "prompt-input__permissions-option",
|
|
@@ -629,7 +672,7 @@ function PromptInputPermissionSelector({ value, onValueChange, question = "How s
|
|
|
629
672
|
className: "prompt-input__permissions-option-description",
|
|
630
673
|
children: mode.description
|
|
631
674
|
})]
|
|
632
|
-
}), /* @__PURE__ */ jsx(
|
|
675
|
+
}), /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { className: "prompt-input__permissions-check" })]
|
|
633
676
|
}, mode.value))
|
|
634
677
|
})]
|
|
635
678
|
}) }) })] });
|
|
@@ -702,7 +745,7 @@ function formatApprovalValue(value) {
|
|
|
702
745
|
* sends the text as the native approval `reason`. Submit (or Enter) sends the
|
|
703
746
|
* current selection — approve by default.
|
|
704
747
|
*/
|
|
705
|
-
function PromptInputApproval({ part, approval: durableApproval, onRespond,
|
|
748
|
+
function PromptInputApproval({ part, approval: durableApproval, onRespond, thinkStub, onExecutionSettled, onSkip, question, count, className, ref, ...props }) {
|
|
706
749
|
const [selected, setSelected] = React.useState("approve");
|
|
707
750
|
const [reason, setReason] = React.useState("");
|
|
708
751
|
const [busy, setBusy] = React.useState(false);
|
|
@@ -717,7 +760,7 @@ function PromptInputApproval({ part, approval: durableApproval, onRespond, execu
|
|
|
717
760
|
setBusy(false);
|
|
718
761
|
}, [approvalId]);
|
|
719
762
|
if (!part && !durableApproval) return null;
|
|
720
|
-
if (approval ? !onRespond : !(
|
|
763
|
+
if (approval ? !onRespond : !(thinkStub && (paused || durableApproval))) return null;
|
|
721
764
|
const toolName = durableApproval?.descriptor.action ?? (part ? getToolName(part) : "action");
|
|
722
765
|
const respond = async (approved) => {
|
|
723
766
|
if (busy) return;
|
|
@@ -730,10 +773,11 @@ function PromptInputApproval({ part, approval: durableApproval, onRespond, execu
|
|
|
730
773
|
approved,
|
|
731
774
|
reason: denyReason
|
|
732
775
|
});
|
|
733
|
-
else if (paused) await (approved ?
|
|
734
|
-
else if (durableApproval) await (approved ?
|
|
776
|
+
else if (paused && thinkStub) await (approved ? thinkStub.approveExecution(paused.executionId) : thinkStub.rejectExecution(paused.executionId, denyReason));
|
|
777
|
+
else if (durableApproval && thinkStub) await (approved ? thinkStub.approveExecution(durableApproval.executionId) : thinkStub.rejectExecution(durableApproval.executionId, denyReason));
|
|
735
778
|
} finally {
|
|
736
779
|
setBusy(false);
|
|
780
|
+
if (!approval) onExecutionSettled?.();
|
|
737
781
|
}
|
|
738
782
|
};
|
|
739
783
|
const submit = () => void respond(selected === "approve");
|
|
@@ -881,14 +925,6 @@ function PromptInputApproval({ part, approval: durableApproval, onRespond, execu
|
|
|
881
925
|
});
|
|
882
926
|
}
|
|
883
927
|
const PromptInputSelect = Select;
|
|
884
|
-
function PromptInputSelectTrigger(props) {
|
|
885
|
-
return /* @__PURE__ */ jsx(SelectTrigger, { ...props });
|
|
886
|
-
}
|
|
887
|
-
function PromptInputSelectContent(props) {
|
|
888
|
-
return /* @__PURE__ */ jsx(SelectPortal, { children: /* @__PURE__ */ jsx(SelectPositioner, { children: /* @__PURE__ */ jsx(SelectContent, { ...props }) }) });
|
|
889
|
-
}
|
|
890
|
-
const PromptInputSelectItem = SelectItem;
|
|
891
|
-
const PromptInputSelectValue = SelectValue;
|
|
892
928
|
const PromptInputHoverCardContext = React.createContext(null);
|
|
893
929
|
function PromptInputHoverCard({ openDelay = 0, closeDelay = 0, className, children, ref, ...props }) {
|
|
894
930
|
const [open, setOpen] = React.useState(false);
|
|
@@ -945,9 +981,9 @@ function PromptInputHoverCardContent({ className, ref, ...props }) {
|
|
|
945
981
|
...props
|
|
946
982
|
});
|
|
947
983
|
}
|
|
948
|
-
const PromptInputTabsList =
|
|
949
|
-
const PromptInputTab = Tab;
|
|
950
|
-
const PromptInputTabBody =
|
|
984
|
+
const PromptInputTabsList = Tabs.List;
|
|
985
|
+
const PromptInputTab = Tabs.Tab;
|
|
986
|
+
const PromptInputTabBody = Tabs.Panel;
|
|
951
987
|
function PromptInputTabLabel({ className, ref, ...props }) {
|
|
952
988
|
return /* @__PURE__ */ jsx("h3", {
|
|
953
989
|
ref,
|
|
@@ -963,18 +999,18 @@ function PromptInputTabItem({ className, ref, ...props }) {
|
|
|
963
999
|
});
|
|
964
1000
|
}
|
|
965
1001
|
const PromptInputCommand = Combobox;
|
|
966
|
-
const PromptInputCommandInput =
|
|
1002
|
+
const PromptInputCommandInput = Combobox.Input;
|
|
967
1003
|
function PromptInputCommandList({ className, ref, ...props }) {
|
|
968
|
-
return /* @__PURE__ */ jsx(
|
|
1004
|
+
return /* @__PURE__ */ jsx(Combobox.List, {
|
|
969
1005
|
ref,
|
|
970
1006
|
className: cx("prompt-input__command-list", className),
|
|
971
1007
|
...props
|
|
972
1008
|
});
|
|
973
1009
|
}
|
|
974
|
-
const PromptInputCommandEmpty =
|
|
975
|
-
const PromptInputCommandGroup =
|
|
976
|
-
const PromptInputCommandItem =
|
|
977
|
-
const PromptInputCommandSeparator =
|
|
1010
|
+
const PromptInputCommandEmpty = Combobox.Empty;
|
|
1011
|
+
const PromptInputCommandGroup = Combobox.Group;
|
|
1012
|
+
const PromptInputCommandItem = Combobox.Item;
|
|
1013
|
+
const PromptInputCommandSeparator = Combobox.Separator;
|
|
978
1014
|
function defaultSubmitIcon(status) {
|
|
979
1015
|
switch (status) {
|
|
980
1016
|
case "submitted": return /* @__PURE__ */ jsx(SpinnerIcon, { className: "prompt-input__submit-spinner" });
|
|
@@ -1066,4 +1102,4 @@ function createId() {
|
|
|
1066
1102
|
return globalThis.crypto?.randomUUID?.() ?? `prompt-input-${Date.now()}-${Math.random()}`;
|
|
1067
1103
|
}
|
|
1068
1104
|
//#endregion
|
|
1069
|
-
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputSelect,
|
|
1105
|
+
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputSelect, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as ButtonProps } from "../Button-
|
|
3
|
-
import {
|
|
1
|
+
import { Collapsible } from "./Collapsible.js";
|
|
2
|
+
import { r as ButtonProps } from "../Button-FX_hpqxm.js";
|
|
3
|
+
import { ScrollArea } from "./ScrollArea.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/Queue.d.ts
|
|
7
|
-
interface QueueMessagePart {
|
|
8
|
-
type: string;
|
|
9
|
-
text?: string;
|
|
10
|
-
url?: string;
|
|
11
|
-
filename?: string;
|
|
12
|
-
mediaType?: string;
|
|
13
|
-
}
|
|
14
|
-
interface QueueMessage {
|
|
15
|
-
id: string;
|
|
16
|
-
parts: QueueMessagePart[];
|
|
17
|
-
}
|
|
18
7
|
interface QueueTodo {
|
|
19
8
|
id: string;
|
|
20
9
|
title: string;
|
|
@@ -72,7 +61,7 @@ declare function Queue({
|
|
|
72
61
|
}: QueueProps & {
|
|
73
62
|
ref?: React.Ref<HTMLDivElement>;
|
|
74
63
|
}): React.JSX.Element;
|
|
75
|
-
interface QueueSectionProps extends Omit<
|
|
64
|
+
interface QueueSectionProps extends Omit<React.ComponentProps<typeof Collapsible.Root>, "className" | "unstyled"> {
|
|
76
65
|
className?: string;
|
|
77
66
|
}
|
|
78
67
|
/**
|
|
@@ -87,7 +76,7 @@ declare function QueueSection({
|
|
|
87
76
|
}: QueueSectionProps & {
|
|
88
77
|
ref?: React.Ref<HTMLDivElement>;
|
|
89
78
|
}): React.JSX.Element;
|
|
90
|
-
interface QueueSectionTriggerProps extends Omit<
|
|
79
|
+
interface QueueSectionTriggerProps extends Omit<React.ComponentProps<typeof Collapsible.Trigger>, "className" | "unstyled"> {
|
|
91
80
|
className?: string;
|
|
92
81
|
}
|
|
93
82
|
declare function QueueSectionTrigger({
|
|
@@ -115,7 +104,7 @@ declare function QueueSectionLabel({
|
|
|
115
104
|
}: QueueSectionLabelProps & {
|
|
116
105
|
ref?: React.Ref<HTMLSpanElement>;
|
|
117
106
|
}): React.JSX.Element;
|
|
118
|
-
interface QueueListProps extends Omit<
|
|
107
|
+
interface QueueListProps extends Omit<React.ComponentProps<typeof ScrollArea.Root>, "className"> {
|
|
119
108
|
className?: string;
|
|
120
109
|
}
|
|
121
110
|
declare function QueueList({
|
|
@@ -126,7 +115,7 @@ declare function QueueList({
|
|
|
126
115
|
}: QueueListProps & {
|
|
127
116
|
ref?: React.Ref<HTMLDivElement>;
|
|
128
117
|
}): React.JSX.Element;
|
|
129
|
-
interface QueueSectionContentProps extends Omit<
|
|
118
|
+
interface QueueSectionContentProps extends Omit<React.ComponentProps<typeof Collapsible.Panel>, "className" | "unstyled"> {
|
|
130
119
|
className?: string;
|
|
131
120
|
}
|
|
132
121
|
declare function QueueSectionContent({
|
|
@@ -238,4 +227,4 @@ declare function QueueItemFile({
|
|
|
238
227
|
ref?: React.Ref<HTMLDivElement>;
|
|
239
228
|
}): React.JSX.Element;
|
|
240
229
|
//#endregion
|
|
241
|
-
export { Queue, QueueItem, QueueItemAction, QueueItemActionProps, QueueItemActions, QueueItemActionsProps, QueueItemAttachment, QueueItemAttachmentProps, QueueItemContent, QueueItemContentProps, QueueItemDescription, QueueItemDescriptionProps, QueueItemFile, QueueItemFileProps, QueueItemImage, QueueItemImageProps, QueueItemIndicator, QueueItemIndicatorProps, QueueItemProps, QueueItemStatus, QueueList, QueueListProps,
|
|
230
|
+
export { Queue, QueueItem, QueueItemAction, QueueItemActionProps, QueueItemActions, QueueItemActionsProps, QueueItemAttachment, QueueItemAttachmentProps, QueueItemContent, QueueItemContentProps, QueueItemDescription, QueueItemDescriptionProps, QueueItemFile, QueueItemFileProps, QueueItemImage, QueueItemImageProps, QueueItemIndicator, QueueItemIndicatorProps, QueueItemProps, QueueItemStatus, QueueList, QueueListProps, QueueProps, QueueSection, QueueSectionContent, QueueSectionContentProps, QueueSectionLabel, QueueSectionLabelProps, QueueSectionProps, QueueSectionTrigger, QueueSectionTriggerProps, QueueTodo };
|
package/dist/components/Queue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Collapsible } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import { a as CheckIcon, c as ChevronRightIcon, h as FileIcon, u as DotIcon } from "../icons-
|
|
3
|
+
import { a as CheckIcon, c as ChevronRightIcon, h as FileIcon, u as DotIcon } from "../icons-Ba9THQKz.js";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
6
6
|
import { ScrollArea } from "./ScrollArea.js";
|
|
@@ -57,7 +57,7 @@ function Queue({ className, children, ref, ...props }) {
|
|
|
57
57
|
* of QueueItem children.
|
|
58
58
|
*/
|
|
59
59
|
function QueueSection({ className, defaultOpen = true, ref, ...props }) {
|
|
60
|
-
return /* @__PURE__ */ jsx(
|
|
60
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
61
61
|
ref,
|
|
62
62
|
className: cx("queue__section", className),
|
|
63
63
|
defaultOpen,
|
|
@@ -66,7 +66,7 @@ function QueueSection({ className, defaultOpen = true, ref, ...props }) {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function QueueSectionTrigger({ className, children, ref, ...props }) {
|
|
69
|
-
return /* @__PURE__ */ jsxs(
|
|
69
|
+
return /* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
70
70
|
ref,
|
|
71
71
|
className: cx("queue__section-trigger", className),
|
|
72
72
|
...props,
|
|
@@ -97,7 +97,7 @@ function QueueSectionLabel({ className, children, count, label, icon, ref, ...pr
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
function QueueList({ className, children, ref, ...props }) {
|
|
100
|
-
return /* @__PURE__ */ jsxs(ScrollArea, {
|
|
100
|
+
return /* @__PURE__ */ jsxs(ScrollArea.Root, {
|
|
101
101
|
ref,
|
|
102
102
|
className: cx("queue__list", className),
|
|
103
103
|
...props,
|
|
@@ -117,7 +117,7 @@ function QueueList({ className, children, ref, ...props }) {
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
function QueueSectionContent({ className, ref, ...props }) {
|
|
120
|
-
return /* @__PURE__ */ jsx(
|
|
120
|
+
return /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
121
121
|
ref,
|
|
122
122
|
className: cx("queue__section-content", className),
|
|
123
123
|
...props,
|