@mcp-b/react-components 0.45.0 → 0.46.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-Bibfj7u1.d.ts → AgentChat-BLmQghkt.d.ts} +2 -2
- package/dist/{CodeBlock-8K1p1BDU.js → CodeBlock-BpooTofO.js} +1 -1
- package/dist/{FileTree-QTP57Qz4.js → FileTree-CAXWXH63.js} +1 -1
- package/dist/{McpConnectorForm-MRm1r59e.d.ts → McpConnectorForm-BETdVBRk.d.ts} +1 -1
- package/dist/{McpPluginCatalog-mbGw8FTu.d.ts → McpPluginCatalog-C6ip9IvL.d.ts} +2 -2
- package/dist/{PromptInput-BRX7FhjH.d.ts → PromptInput-DtJHyp0S.d.ts} +27 -22
- package/dist/{SetupChecklist-CZeToAbu.js → SetupChecklist-DyPZWzK2.js} +2 -2
- package/dist/{ThinkChat-CWMcl79Q.js → ThinkChat-qztQ6Clo.js} +4 -1
- package/dist/{ThinkChatActivity-CgvmTXXB.d.ts → ThinkChatActivity-B3lGVS-6.d.ts} +1 -1
- package/dist/{WorkspaceFileView-DJ8Oxz57.js → WorkspaceFileView-BvDbKM2c.js} +2 -2
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.d.ts +1 -1
- package/dist/components/agents-sdk/AgentChat.js +29 -30
- package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/ManagerOffice.d.ts +2 -1
- package/dist/components/agents-sdk/ManagerOffice.js +28 -10
- package/dist/components/agents-sdk/McpConnectionRequest.d.ts +1 -1
- package/dist/components/agents-sdk/McpConnectionRequest.js +10 -4
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +9 -5
- package/dist/components/agents-sdk/McpServerPicker.d.ts +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +2 -2
- package/dist/components/agents-sdk/ModelSelector.js +2 -2
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +5 -2
- package/dist/components/agents-sdk/PromptInputCommands.js +81 -3
- package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.d.ts +3 -3
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +1 -1
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkFullApp.js +2 -2
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +1 -1
- package/dist/components/agents-sdk/ThinkSidepanel.js +22 -9
- package/dist/components/agents-sdk/ThinkThreadPicker.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +1 -1
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
- package/dist/components/ai-sdk/ChainOfThought.js +1 -1
- package/dist/components/ai-sdk/Checkpoint.js +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.d.ts +27 -0
- package/dist/components/ai-sdk/ComposerLink.js +111 -0
- package/dist/components/ai-sdk/ConnectedAppCards.js +1 -1
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.js +18 -2
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
- package/dist/components/ai-sdk/PromptInput.js +65 -59
- package/dist/components/ai-sdk/PromptInputComposerEditor.d.ts +31 -0
- package/dist/components/ai-sdk/PromptInputComposerEditor.js +198 -0
- package/dist/components/ai-sdk/Queue.js +1 -1
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +2 -2
- package/dist/components/extension/CodexModelSelector.js +1 -1
- package/dist/components/extension/ConversationTabPicker.js +1 -1
- package/dist/components/foundations/AppIcon.js +1 -1
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/icons.d.ts +1 -1
- package/dist/components/foundations/icons.js +1 -1
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.js +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.js +2 -2
- package/dist/components/general-purpose/TestResults.js +1 -1
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.js +1 -1
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.js +2 -2
- package/dist/{copy-button-BpA7wQva.js → copy-button-D7ySsRRo.js} +1 -1
- package/dist/{icons-DbrksZyY.js → icons-BNEY4gO5.js} +44 -4
- package/dist/{icons-6ZnyZJiR.d.ts → icons-D0Pd2P9v.d.ts} +9 -4
- package/dist/{mcp-server-SD_S-IpB.js → mcp-server-7NR24ASj.js} +31 -4
- package/dist/{mcp-server-catalog-CCj2ItkV.d.ts → mcp-server-catalog-Cbu483Zb.d.ts} +9 -9
- package/dist/{provider-logos-zjZycgV6.js → provider-logos-DWYY8wNz.js} +31 -6
- package/dist/styles/action-guide.css +4 -0
- package/dist/styles/agent-attention.css +5 -1
- package/dist/styles/agent-chat.css +21 -18
- package/dist/styles/app-icon.css +21 -0
- package/dist/styles/brand-marks.css +22 -0
- package/dist/styles/composer-link.css +99 -0
- package/dist/styles/connected-app-card.css +9 -0
- package/dist/styles/github-motion-mark.css +8 -1
- package/dist/styles/index.css +2 -0
- package/dist/styles/manager-office.css +10 -3
- package/dist/styles/mcp-plugin-catalog.css +4 -0
- package/dist/styles/mcp-server-picker.css +2 -0
- package/dist/styles/prompt-input.css +14 -53
- package/dist/styles/think-sidepanel.css +9 -0
- package/dist/utils/composer-link.d.ts +59 -0
- package/dist/utils/composer-link.js +203 -0
- package/dist/utils/mcp-server-catalog.d.ts +1 -1
- package/dist/utils/mcp-server-catalog.js +9 -9
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { B as PlayIcon } from "../../icons-
|
|
2
|
+
import { B as PlayIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
4
4
|
import { Card } from "../foundations/Card.js";
|
|
5
5
|
import * as React from "react";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { parseComposerHref } from "../../utils/composer-link.js";
|
|
1
2
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { S as FileIcon, i as ArrowRightIcon, r as ArrowLeftIcon } from "../../icons-
|
|
3
|
+
import { S as FileIcon, i as ArrowRightIcon, r as ArrowLeftIcon } from "../../icons-BNEY4gO5.js";
|
|
3
4
|
import { Button } from "../foundations/Button.js";
|
|
4
5
|
import { IconButton } from "../foundations/IconButton.js";
|
|
5
6
|
import { t as AttachmentPreview } from "../../attachment-preview-1CXJvrmb.js";
|
|
6
7
|
import { n as clamp } from "../../format-COCyV98Z.js";
|
|
8
|
+
import { ComposerLink } from "./ComposerLink.js";
|
|
7
9
|
import * as React from "react";
|
|
8
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
import { cjk } from "@streamdown/cjk";
|
|
@@ -78,7 +80,21 @@ const streamdownPlugins = {
|
|
|
78
80
|
cjk,
|
|
79
81
|
code
|
|
80
82
|
};
|
|
81
|
-
|
|
83
|
+
function MessageResponseLink({ href, children, ...props }) {
|
|
84
|
+
return href && parseComposerHref(href) ? /* @__PURE__ */ jsx(ComposerLink, {
|
|
85
|
+
href,
|
|
86
|
+
children
|
|
87
|
+
}) : /* @__PURE__ */ jsx("a", {
|
|
88
|
+
href,
|
|
89
|
+
"data-streamdown": "link",
|
|
90
|
+
...props,
|
|
91
|
+
children
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const messageResponseComponents = {
|
|
95
|
+
img: "img",
|
|
96
|
+
a: MessageResponseLink
|
|
97
|
+
};
|
|
82
98
|
const MessageResponse = React.memo(function MessageResponse({ className, components, ...props }) {
|
|
83
99
|
return /* @__PURE__ */ jsx(Streamdown, {
|
|
84
100
|
className: cx("message__response", "sigvelo-reader-text", className),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { n as ArrowDownIcon } from "../../icons-
|
|
2
|
+
import { n as ArrowDownIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { t as messageScrollerContract } from "../../message-scroller-C8cplcQO.js";
|
|
5
5
|
import "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { n as ArrowDownIcon } from "../../icons-
|
|
2
|
+
import { n as ArrowDownIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { t as messageScrollerContract } from "../../message-scroller-C8cplcQO.js";
|
|
5
5
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { _ as DotIcon, d as CheckIcon, i as ArrowRightIcon } from "../../icons-
|
|
2
|
+
import { _ as DotIcon, d as CheckIcon, i as ArrowRightIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { Popover } from "../foundations/Popover.js";
|
|
4
4
|
import { t as ProgressRing } from "../../progress-ring-Cgii90dC.js";
|
|
5
5
|
import * as React from "react";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AttachmentsContext, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommandComposer, PromptInputCommandComposerProps, PromptInputCommandDefinition, PromptInputCommandTrigger, PromptInputContextAction, PromptInputContextItem, PromptInputContextSelector, PromptInputContextSelectorProps, PromptInputControllerProps, PromptInputDictation, PromptInputDictationProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReference,
|
|
1
|
+
import { $ as PromptInputSubmit, A as PromptInputContextItem, B as PromptInputHoverCard, C as PromptInputButtonProps, Ct as usePromptInputController, D as PromptInputCommandDefinition, E as PromptInputCommandComposerProps, F as PromptInputDictationProps, G as PromptInputHoverCardTriggerProps, H as PromptInputHoverCardContentProps, I as PromptInputFooter, J as PromptInputPermissionSelectorProps, K as PromptInputMessage, L as PromptInputFooterProps, M as PromptInputContextSelectorProps, N as PromptInputControllerProps, O as PromptInputCommandTrigger, P as PromptInputDictation, Q as PromptInputReference, R as PromptInputHeader, S as PromptInputButton, St as usePromptInputAttachments, T as PromptInputCommandComposer, U as PromptInputHoverCardProps, V as PromptInputHoverCardContent, W as PromptInputHoverCardTrigger, X as PromptInputProvider, Y as PromptInputProps, Z as PromptInputProviderProps, _ as PromptInputAttachmentProps, _t as PromptInputTrayProps, a as PromptInputActionAddAttachmentsProps, at as PromptInputTabItemProps, b as PromptInputBody, bt as TooltipSide, c as PromptInputActionMenu, ct as PromptInputTabProps, d as PromptInputActionMenuItem, dt as PromptInputTextarea, et as PromptInputSubmitProps, f as PromptInputActionMenuItemProps, ft as PromptInputTextareaProps, g as PromptInputAttachment, gt as PromptInputTray, h as PromptInputActionMenuTriggerProps, ht as PromptInputTooltipConfig, i as PromptInputActionAddAttachments, it as PromptInputTabItem, j as PromptInputContextSelector, k as PromptInputContextAction, l as PromptInputActionMenuContent, lt as PromptInputTabsList, m as PromptInputActionMenuTrigger, mt as PromptInputToolsProps, n as PermissionMode, nt as PromptInputTabBody, o as PromptInputActionAddScreenshot, ot as PromptInputTabLabel, p as PromptInputActionMenuProps, pt as PromptInputTools, q as PromptInputPermissionSelector, r as PromptInput, rt as PromptInputTabBodyProps, s as PromptInputActionAddScreenshotProps, st as PromptInputTabLabelProps, t as AttachmentsContext, tt as PromptInputTab, u as PromptInputActionMenuContentProps, ut as PromptInputTabsListProps, v as PromptInputAttachments, vt as PromptInputVoiceInput, w as PromptInputButtonTooltip, wt as useProviderAttachments, x as PromptInputBodyProps, xt as composerLinksToReferences, y as PromptInputAttachmentsProps, yt as TextInputContext, z as PromptInputHeaderProps } from "../../PromptInput-DtJHyp0S.js";
|
|
2
|
+
export { AttachmentsContext, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommandComposer, PromptInputCommandComposerProps, PromptInputCommandDefinition, PromptInputCommandTrigger, PromptInputContextAction, PromptInputContextItem, PromptInputContextSelector, PromptInputContextSelectorProps, PromptInputControllerProps, PromptInputDictation, PromptInputDictationProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReference, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, PromptInputTray, PromptInputTrayProps, PromptInputVoiceInput, TextInputContext, TooltipSide, composerLinksToReferences, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { composerTriggerMatch, parseComposerLinks, replaceComposerTrigger } from "../../utils/composer-link.js";
|
|
1
2
|
import { n as mergeBaseClassName, t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { C as FolderIcon, J as SquareIcon, L as PaperclipIcon, M as MicrophoneIcon, P as MonitorIcon, S as FileIcon, V as PlusIcon, Y as StopIcon, a as ArrowUpIcon, d as CheckIcon, et as WarningIcon, f as ChevronDownIcon, nt as XIcon, q as SpinnerIcon, tt as WrenchIcon } from "../../icons-
|
|
3
|
+
import { C as FolderIcon, J as SquareIcon, L as PaperclipIcon, M as MicrophoneIcon, P as MonitorIcon, S as FileIcon, V as PlusIcon, Y as StopIcon, a as ArrowUpIcon, d as CheckIcon, et as WarningIcon, f as ChevronDownIcon, nt as XIcon, q as SpinnerIcon, tt as WrenchIcon } from "../../icons-BNEY4gO5.js";
|
|
3
4
|
import { Button } from "../foundations/Button.js";
|
|
4
5
|
import { Tooltip } from "../foundations/Tooltip.js";
|
|
5
6
|
import { IconButton } from "../foundations/IconButton.js";
|
|
@@ -11,6 +12,8 @@ import { Tabs } from "../foundations/Tabs.js";
|
|
|
11
12
|
import { t as AttachmentPreview } from "../../attachment-preview-1CXJvrmb.js";
|
|
12
13
|
import { a as formatErrorMessage, i as formatClock, n as clamp } from "../../format-COCyV98Z.js";
|
|
13
14
|
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
15
|
+
import { ComposerLink } from "./ComposerLink.js";
|
|
16
|
+
import { PromptInputComposerEditor, readComposerDom, writeComposerDom } from "./PromptInputComposerEditor.js";
|
|
14
17
|
import * as React from "react";
|
|
15
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
19
|
//#region src/components/ai-sdk/PromptInput.tsx
|
|
@@ -235,17 +238,21 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
235
238
|
]);
|
|
236
239
|
const handleSubmit = React.useCallback(async (event) => {
|
|
237
240
|
event.preventDefault();
|
|
238
|
-
const
|
|
239
|
-
const
|
|
241
|
+
const field = event.currentTarget.querySelector("[data-prompt-input-textarea=\"true\"]");
|
|
242
|
+
const fieldText = field instanceof HTMLTextAreaElement ? field.value : field?.isContentEditable ? readComposerDom(field) : "";
|
|
243
|
+
const text = (controller?.textInput.value ?? fieldText).trim();
|
|
240
244
|
const submittedFiles = await Promise.all(files.map(resolveSubmittedFile));
|
|
241
245
|
try {
|
|
242
246
|
const submission = onSubmit?.({
|
|
243
247
|
text,
|
|
244
248
|
files: submittedFiles
|
|
245
249
|
}, event);
|
|
246
|
-
if (!controller &&
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
if (!controller && field instanceof HTMLTextAreaElement) {
|
|
251
|
+
field.value = "";
|
|
252
|
+
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
253
|
+
} else if (!controller && field?.isContentEditable) {
|
|
254
|
+
field.replaceChildren();
|
|
255
|
+
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
249
256
|
}
|
|
250
257
|
controller?.textInput.clear();
|
|
251
258
|
clearAttachments();
|
|
@@ -525,10 +532,11 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
|
|
|
525
532
|
voice.clear();
|
|
526
533
|
return;
|
|
527
534
|
}
|
|
528
|
-
const
|
|
529
|
-
if (!
|
|
530
|
-
Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set?.call(
|
|
531
|
-
|
|
535
|
+
const field = buttonRef.current?.form?.querySelector("[data-prompt-input-textarea=\"true\"]");
|
|
536
|
+
if (!field) return;
|
|
537
|
+
if (field instanceof HTMLTextAreaElement) Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set?.call(field, appendDictationTranscript(field.value, addition));
|
|
538
|
+
else if (field.isContentEditable) writeComposerDom(field, appendDictationTranscript(readComposerDom(field), addition));
|
|
539
|
+
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
532
540
|
voice.clear();
|
|
533
541
|
}, [
|
|
534
542
|
controller,
|
|
@@ -988,25 +996,42 @@ function PromptInputTabLabel({ className, ref, ...props }) {
|
|
|
988
996
|
...props
|
|
989
997
|
});
|
|
990
998
|
}
|
|
991
|
-
function PromptInputTabItem({ className, ref, ...props }) {
|
|
992
|
-
return /* @__PURE__ */ jsx(
|
|
999
|
+
function PromptInputTabItem({ className, href, icon, children, ref, ...props }) {
|
|
1000
|
+
if (href) return /* @__PURE__ */ jsx(ComposerLink, {
|
|
1001
|
+
href,
|
|
1002
|
+
icon,
|
|
1003
|
+
className: cx("prompt-input__tab-item", className),
|
|
1004
|
+
children
|
|
1005
|
+
});
|
|
1006
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
993
1007
|
ref,
|
|
994
1008
|
className: cx("prompt-input__tab-item", className),
|
|
995
|
-
...props
|
|
1009
|
+
...props,
|
|
1010
|
+
children: [icon, children]
|
|
996
1011
|
});
|
|
997
1012
|
}
|
|
1013
|
+
function composerLinksToReferences(text) {
|
|
1014
|
+
return parseComposerLinks(text).map((link) => ({
|
|
1015
|
+
id: `${link.kind}:${link.value}`,
|
|
1016
|
+
value: link.value,
|
|
1017
|
+
label: link.label,
|
|
1018
|
+
href: link.href,
|
|
1019
|
+
iconSrc: link.iconSrc,
|
|
1020
|
+
trigger: link.kind === "mcp" || link.kind === "tab" ? "@" : "/"
|
|
1021
|
+
}));
|
|
1022
|
+
}
|
|
998
1023
|
/**
|
|
999
|
-
* Controlled
|
|
1000
|
-
*
|
|
1024
|
+
* Controlled composer field with slash-command and mention discovery.
|
|
1025
|
+
* Selection inserts a special href into the draft — not a chip button.
|
|
1001
1026
|
*/
|
|
1002
|
-
function PromptInputCommandComposer({ commands, mentionCommands, value, onValueChange, onCommandSelect, emptyMessage = "No commands found.", mentionEmptyMessage = "No MCP servers found.", onKeyDown, ref,
|
|
1027
|
+
function PromptInputCommandComposer({ commands, mentionCommands, value, onValueChange, onCommandSelect, emptyMessage = "No commands found.", mentionEmptyMessage = "No MCP servers found.", onKeyDown, ref, placeholder, disabled, className, minHeight, maxHeight, "aria-label": ariaLabel }) {
|
|
1003
1028
|
const inputRef = React.useRef(null);
|
|
1004
1029
|
const [dismissedValue, setDismissedValue] = React.useState(null);
|
|
1005
1030
|
React.useImperativeHandle(ref, () => inputRef.current, []);
|
|
1006
|
-
const match =
|
|
1007
|
-
const trigger = match?.
|
|
1031
|
+
const match = composerTriggerMatch(value);
|
|
1032
|
+
const trigger = match?.trigger;
|
|
1008
1033
|
const sourceCommands = trigger === "@" ? mentionCommands ?? [] : commands;
|
|
1009
|
-
const normalizedQuery = (match?.
|
|
1034
|
+
const normalizedQuery = (match?.query.trim() ?? "").toLocaleLowerCase();
|
|
1010
1035
|
const filtered = sourceCommands.filter((command) => {
|
|
1011
1036
|
if (!normalizedQuery) return true;
|
|
1012
1037
|
return [
|
|
@@ -1022,6 +1047,12 @@ function PromptInputCommandComposer({ commands, mentionCommands, value, onValueC
|
|
|
1022
1047
|
label,
|
|
1023
1048
|
items: filtered.filter((command) => (command.group ?? "") === label)
|
|
1024
1049
|
}));
|
|
1050
|
+
const selectCommand = (command) => {
|
|
1051
|
+
const nextTrigger = trigger ?? "/";
|
|
1052
|
+
onValueChange(replaceComposerTrigger(value, command, nextTrigger));
|
|
1053
|
+
setDismissedValue(null);
|
|
1054
|
+
onCommandSelect(command, nextTrigger);
|
|
1055
|
+
};
|
|
1025
1056
|
return /* @__PURE__ */ jsxs(Autocomplete.Root, {
|
|
1026
1057
|
items: groups,
|
|
1027
1058
|
filteredItems: groups,
|
|
@@ -1038,11 +1069,20 @@ function PromptInputCommandComposer({ commands, mentionCommands, value, onValueC
|
|
|
1038
1069
|
onOpenChange: (nextOpen) => {
|
|
1039
1070
|
if (!nextOpen) setDismissedValue(value);
|
|
1040
1071
|
},
|
|
1041
|
-
children: [/* @__PURE__ */ jsx(Autocomplete.Input, { render: /* @__PURE__ */ jsx(
|
|
1042
|
-
...textareaProps,
|
|
1072
|
+
children: [/* @__PURE__ */ jsx(Autocomplete.Input, { render: /* @__PURE__ */ jsx(PromptInputComposerEditor, {
|
|
1043
1073
|
ref: inputRef,
|
|
1044
|
-
value,
|
|
1045
|
-
|
|
1074
|
+
draft: value,
|
|
1075
|
+
onDraftChange: (next) => {
|
|
1076
|
+
setDismissedValue(null);
|
|
1077
|
+
onValueChange(next);
|
|
1078
|
+
},
|
|
1079
|
+
onKeyDown,
|
|
1080
|
+
placeholder,
|
|
1081
|
+
disabled,
|
|
1082
|
+
className,
|
|
1083
|
+
minHeight,
|
|
1084
|
+
maxHeight,
|
|
1085
|
+
"aria-label": ariaLabel
|
|
1046
1086
|
}) }), /* @__PURE__ */ jsx(Autocomplete.Portal, { children: /* @__PURE__ */ jsx(Autocomplete.Positioner, {
|
|
1047
1087
|
anchor: () => inputRef.current?.closest(".prompt-input__body") ?? null,
|
|
1048
1088
|
side: "top",
|
|
@@ -1061,7 +1101,7 @@ function PromptInputCommandComposer({ commands, mentionCommands, value, onValueC
|
|
|
1061
1101
|
value: command,
|
|
1062
1102
|
disabled: command.disabled,
|
|
1063
1103
|
className: "prompt-input__command-item",
|
|
1064
|
-
onClick: () =>
|
|
1104
|
+
onClick: () => selectCommand(command),
|
|
1065
1105
|
children: [command.icon ? /* @__PURE__ */ jsx("span", {
|
|
1066
1106
|
className: "prompt-input__command-icon",
|
|
1067
1107
|
children: command.icon
|
|
@@ -1089,40 +1129,6 @@ function PromptInputCommandComposer({ commands, mentionCommands, value, onValueC
|
|
|
1089
1129
|
}) })]
|
|
1090
1130
|
});
|
|
1091
1131
|
}
|
|
1092
|
-
/** Removable inline context selected from slash-command or mention pickers. */
|
|
1093
|
-
function PromptInputReferences({ references, onRemove, className, ref, ...props }) {
|
|
1094
|
-
if (!references.length) return null;
|
|
1095
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1096
|
-
ref,
|
|
1097
|
-
className: cx("prompt-input__references", className),
|
|
1098
|
-
role: "group",
|
|
1099
|
-
"aria-label": "Selected context",
|
|
1100
|
-
...props,
|
|
1101
|
-
children: references.map((reference) => /* @__PURE__ */ jsxs(Button, {
|
|
1102
|
-
type: "button",
|
|
1103
|
-
variant: "ghost",
|
|
1104
|
-
color: "primary",
|
|
1105
|
-
size: "xs",
|
|
1106
|
-
className: "prompt-input__reference",
|
|
1107
|
-
"aria-label": `Remove ${reference.label}`,
|
|
1108
|
-
onClick: () => onRemove(reference),
|
|
1109
|
-
children: [
|
|
1110
|
-
reference.icon ? /* @__PURE__ */ jsx("span", {
|
|
1111
|
-
className: "prompt-input__reference-icon",
|
|
1112
|
-
children: reference.icon
|
|
1113
|
-
}) : null,
|
|
1114
|
-
/* @__PURE__ */ jsx("span", {
|
|
1115
|
-
className: "prompt-input__reference-label sigvelo-truncate",
|
|
1116
|
-
children: reference.label
|
|
1117
|
-
}),
|
|
1118
|
-
/* @__PURE__ */ jsx(XIcon, {
|
|
1119
|
-
className: "prompt-input__reference-remove",
|
|
1120
|
-
size: 14
|
|
1121
|
-
})
|
|
1122
|
-
]
|
|
1123
|
-
}, `${reference.trigger ?? "reference"}:${reference.id}`))
|
|
1124
|
-
});
|
|
1125
|
-
}
|
|
1126
1132
|
/** Controlled composer-footer picker for a host-owned folder or working context. */
|
|
1127
1133
|
function PromptInputContextSelector({ items, value, onValueChange, categoryLabel = "Folder", unavailableLabel = "Folder unavailable", action }) {
|
|
1128
1134
|
const selected = items.find((item) => item.value === value);
|
|
@@ -1290,4 +1296,4 @@ function createId() {
|
|
|
1290
1296
|
return globalThis.crypto?.randomUUID?.() ?? `prompt-input-${Date.now()}-${Math.random()}`;
|
|
1291
1297
|
}
|
|
1292
1298
|
//#endregion
|
|
1293
|
-
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider,
|
|
1299
|
+
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, PromptInputTray, composerLinksToReferences, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/ai-sdk/PromptInputComposerEditor.d.ts
|
|
4
|
+
declare function writeComposerDom(element: HTMLElement, markdown: string): void;
|
|
5
|
+
declare function readComposerDom(element: HTMLElement): string;
|
|
6
|
+
interface PromptInputComposerEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "value"> {
|
|
7
|
+
/** Markdown draft. Named apart from Autocomplete's `value` so the two cannot collide. */
|
|
8
|
+
draft: string;
|
|
9
|
+
onDraftChange: (value: string) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
minHeight?: number;
|
|
12
|
+
maxHeight?: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function PromptInputComposerEditor({
|
|
16
|
+
className,
|
|
17
|
+
placeholder,
|
|
18
|
+
minHeight,
|
|
19
|
+
maxHeight,
|
|
20
|
+
draft,
|
|
21
|
+
onDraftChange,
|
|
22
|
+
onKeyDown,
|
|
23
|
+
onPaste,
|
|
24
|
+
disabled,
|
|
25
|
+
ref,
|
|
26
|
+
...props
|
|
27
|
+
}: PromptInputComposerEditorProps & {
|
|
28
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
29
|
+
}): React.JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { PromptInputComposerEditor, PromptInputComposerEditorProps, readComposerDom, writeComposerDom };
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { parseComposerHref, sampleImageAccent, splitComposerDraft } from "../../utils/composer-link.js";
|
|
2
|
+
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
|
+
import { n as clamp } from "../../format-COCyV98Z.js";
|
|
4
|
+
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
5
|
+
import { composerLinkAccent, composerLinkIconSrc, composerLinkUsesCube } from "./ComposerLink.js";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/ai-sdk/PromptInputComposerEditor.tsx
|
|
9
|
+
const MIN_COMPOSER_HEIGHT_PX = 24;
|
|
10
|
+
const MAX_COMPOSER_HEIGHT_PX = 240;
|
|
11
|
+
function appendPlainText(parent, text) {
|
|
12
|
+
text.split("\n").forEach((line, index) => {
|
|
13
|
+
if (index > 0) parent.append(document.createElement("br"));
|
|
14
|
+
if (line) parent.append(document.createTextNode(line));
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function createComposerLinkElement(parts, label) {
|
|
18
|
+
const link = document.createElement("a");
|
|
19
|
+
link.className = "composer-link";
|
|
20
|
+
link.href = parts.href;
|
|
21
|
+
link.contentEditable = "false";
|
|
22
|
+
link.draggable = false;
|
|
23
|
+
link.tabIndex = -1;
|
|
24
|
+
link.dataset.composerLink = parts.kind;
|
|
25
|
+
link.rel = "nofollow";
|
|
26
|
+
link.addEventListener("click", (event) => event.preventDefault());
|
|
27
|
+
const accent = composerLinkAccent(parts);
|
|
28
|
+
if (accent) link.style.setProperty("--composer-link-color", accent);
|
|
29
|
+
const src = composerLinkIconSrc(parts);
|
|
30
|
+
if (src) {
|
|
31
|
+
const image = document.createElement("img");
|
|
32
|
+
image.alt = "";
|
|
33
|
+
image.setAttribute("aria-hidden", "true");
|
|
34
|
+
image.className = "composer-link__icon";
|
|
35
|
+
image.decoding = "async";
|
|
36
|
+
image.draggable = false;
|
|
37
|
+
image.referrerPolicy = "no-referrer";
|
|
38
|
+
image.src = src;
|
|
39
|
+
if (!accent) {
|
|
40
|
+
const applySample = () => {
|
|
41
|
+
const sampled = sampleImageAccent(image);
|
|
42
|
+
if (sampled) link.style.setProperty("--composer-link-color", sampled);
|
|
43
|
+
};
|
|
44
|
+
if (image.complete) applySample();
|
|
45
|
+
else image.addEventListener("load", applySample, { once: true });
|
|
46
|
+
}
|
|
47
|
+
link.append(image);
|
|
48
|
+
} else if (composerLinkUsesCube(parts)) {
|
|
49
|
+
const icon = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
50
|
+
icon.setAttribute("viewBox", "0 0 24 24");
|
|
51
|
+
icon.setAttribute("fill", "none");
|
|
52
|
+
icon.setAttribute("stroke", "currentColor");
|
|
53
|
+
icon.setAttribute("stroke-width", "1.75");
|
|
54
|
+
icon.setAttribute("stroke-linecap", "round");
|
|
55
|
+
icon.setAttribute("stroke-linejoin", "round");
|
|
56
|
+
icon.setAttribute("aria-hidden", "true");
|
|
57
|
+
icon.setAttribute("focusable", "false");
|
|
58
|
+
icon.classList.add("composer-link__icon");
|
|
59
|
+
for (const d of [
|
|
60
|
+
"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",
|
|
61
|
+
"m3.3 7 8.7 5 8.7-5",
|
|
62
|
+
"M12 22V12"
|
|
63
|
+
]) {
|
|
64
|
+
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
65
|
+
path.setAttribute("d", d);
|
|
66
|
+
icon.append(path);
|
|
67
|
+
}
|
|
68
|
+
link.append(icon);
|
|
69
|
+
}
|
|
70
|
+
const text = document.createElement("span");
|
|
71
|
+
text.className = "composer-link__label";
|
|
72
|
+
text.textContent = label;
|
|
73
|
+
link.append(text);
|
|
74
|
+
return link;
|
|
75
|
+
}
|
|
76
|
+
function writeComposerDom(element, markdown) {
|
|
77
|
+
element.replaceChildren();
|
|
78
|
+
for (const segment of splitComposerDraft(markdown)) if (segment.type === "text") appendPlainText(element, segment.value);
|
|
79
|
+
else element.append(createComposerLinkElement(segment.parts, segment.label));
|
|
80
|
+
}
|
|
81
|
+
function readComposerDom(element) {
|
|
82
|
+
let markdown = "";
|
|
83
|
+
const walk = (node) => {
|
|
84
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
85
|
+
markdown += node.textContent ?? "";
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (node instanceof HTMLBRElement) {
|
|
89
|
+
markdown += "\n";
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (node instanceof HTMLAnchorElement && node.classList.contains("composer-link")) {
|
|
93
|
+
const href = node.getAttribute("href") ?? "";
|
|
94
|
+
const label = node.querySelector(".composer-link__label")?.textContent ?? node.textContent ?? "";
|
|
95
|
+
const parsed = parseComposerHref(href);
|
|
96
|
+
markdown += `[${label}](${parsed?.href ?? href})`;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (node instanceof HTMLElement && node !== element && node.tagName === "DIV") {
|
|
100
|
+
if (markdown && !markdown.endsWith("\n")) markdown += "\n";
|
|
101
|
+
}
|
|
102
|
+
node.childNodes.forEach(walk);
|
|
103
|
+
};
|
|
104
|
+
walk(element);
|
|
105
|
+
return markdown;
|
|
106
|
+
}
|
|
107
|
+
function placeCaretAtEnd(element) {
|
|
108
|
+
const selection = window.getSelection();
|
|
109
|
+
if (!selection) return;
|
|
110
|
+
const range = document.createRange();
|
|
111
|
+
range.selectNodeContents(element);
|
|
112
|
+
range.collapse(false);
|
|
113
|
+
selection.removeAllRanges();
|
|
114
|
+
selection.addRange(range);
|
|
115
|
+
}
|
|
116
|
+
function PromptInputComposerEditor({ className, placeholder = "How can I help?", minHeight = MIN_COMPOSER_HEIGHT_PX, maxHeight = MAX_COMPOSER_HEIGHT_PX, draft, onDraftChange, onKeyDown, onPaste, disabled, ref, ...props }) {
|
|
117
|
+
const innerRef = React.useRef(null);
|
|
118
|
+
const lastWritten = React.useRef(null);
|
|
119
|
+
const isComposingRef = React.useRef(false);
|
|
120
|
+
const resize = React.useCallback(() => {
|
|
121
|
+
const el = innerRef.current;
|
|
122
|
+
if (!el) return;
|
|
123
|
+
el.style.height = "auto";
|
|
124
|
+
const next = clamp(el.scrollHeight, minHeight, maxHeight);
|
|
125
|
+
el.style.height = `${next}px`;
|
|
126
|
+
el.style.overflowY = el.scrollHeight > maxHeight ? "auto" : "hidden";
|
|
127
|
+
}, [maxHeight, minHeight]);
|
|
128
|
+
React.useLayoutEffect(() => {
|
|
129
|
+
const el = innerRef.current;
|
|
130
|
+
if (!el) return;
|
|
131
|
+
Object.defineProperty(el, "value", {
|
|
132
|
+
configurable: true,
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: () => lastWritten.current ?? "",
|
|
135
|
+
set: () => void 0
|
|
136
|
+
});
|
|
137
|
+
}, []);
|
|
138
|
+
React.useLayoutEffect(() => {
|
|
139
|
+
const el = innerRef.current;
|
|
140
|
+
if (!el) return;
|
|
141
|
+
if (lastWritten.current === draft && (el.childNodes.length > 0 || draft === "")) {
|
|
142
|
+
if (draft === "" && el.childNodes.length > 0) writeComposerDom(el, draft);
|
|
143
|
+
resize();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
writeComposerDom(el, draft);
|
|
147
|
+
lastWritten.current = draft;
|
|
148
|
+
if (document.activeElement === el) placeCaretAtEnd(el);
|
|
149
|
+
resize();
|
|
150
|
+
}, [resize, draft]);
|
|
151
|
+
return /* @__PURE__ */ jsx("div", {
|
|
152
|
+
...props,
|
|
153
|
+
ref: mergeRefs(innerRef, ref),
|
|
154
|
+
role: "textbox",
|
|
155
|
+
contentEditable: disabled ? false : true,
|
|
156
|
+
suppressContentEditableWarning: true,
|
|
157
|
+
"aria-disabled": disabled || void 0,
|
|
158
|
+
"aria-label": props["aria-label"] ?? "Message",
|
|
159
|
+
"aria-multiline": "true",
|
|
160
|
+
"aria-placeholder": placeholder,
|
|
161
|
+
"data-prompt-input-textarea": "true",
|
|
162
|
+
"data-placeholder": placeholder,
|
|
163
|
+
"data-empty": draft.trim() ? void 0 : "",
|
|
164
|
+
className: cx("prompt-input__textarea", className),
|
|
165
|
+
style: {
|
|
166
|
+
minHeight,
|
|
167
|
+
maxHeight,
|
|
168
|
+
...props.style
|
|
169
|
+
},
|
|
170
|
+
onCompositionStart: (event) => {
|
|
171
|
+
isComposingRef.current = true;
|
|
172
|
+
props.onCompositionStart?.(event);
|
|
173
|
+
},
|
|
174
|
+
onCompositionEnd: (event) => {
|
|
175
|
+
isComposingRef.current = false;
|
|
176
|
+
props.onCompositionEnd?.(event);
|
|
177
|
+
},
|
|
178
|
+
onInput: () => {
|
|
179
|
+
const el = innerRef.current;
|
|
180
|
+
if (!el) return;
|
|
181
|
+
const next = readComposerDom(el);
|
|
182
|
+
lastWritten.current = next;
|
|
183
|
+
onDraftChange(next);
|
|
184
|
+
resize();
|
|
185
|
+
},
|
|
186
|
+
onKeyDown: (event) => {
|
|
187
|
+
onKeyDown?.(event);
|
|
188
|
+
if (event.defaultPrevented) return;
|
|
189
|
+
if (event.key === "Enter" && !event.shiftKey && !isComposingRef.current && !event.nativeEvent.isComposing) {
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
event.currentTarget.closest("form")?.requestSubmit();
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
onPaste
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
export { PromptInputComposerEditor, readComposerDom, writeComposerDom };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Collapsible } from "../foundations/Collapsible.js";
|
|
3
|
-
import { S as FileIcon, _ as DotIcon, d as CheckIcon, p as ChevronRightIcon } from "../../icons-
|
|
3
|
+
import { S as FileIcon, _ as DotIcon, d as CheckIcon, p as ChevronRightIcon } from "../../icons-BNEY4gO5.js";
|
|
4
4
|
import { Button } from "../foundations/Button.js";
|
|
5
5
|
import { ScrollArea } from "../foundations/ScrollArea.js";
|
|
6
6
|
import "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { q as SpinnerIcon } from "../../icons-
|
|
2
|
+
import { q as SpinnerIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { Activity, ActivityContent, ActivityText, ActivityTrigger } from "./Activity.js";
|
|
4
4
|
import { MessageResponse } from "./Message.js";
|
|
5
5
|
import * as React from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Collapsible } from "../foundations/Collapsible.js";
|
|
3
|
-
import { D as LinkIcon, p as ChevronRightIcon } from "../../icons-
|
|
3
|
+
import { D as LinkIcon, p as ChevronRightIcon } from "../../icons-BNEY4gO5.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/ai-sdk/Sources.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Collapsible } from "../foundations/Collapsible.js";
|
|
3
|
-
import { S as FileIcon, W as SearchIcon, p as ChevronRightIcon } from "../../icons-
|
|
3
|
+
import { S as FileIcon, W as SearchIcon, p as ChevronRightIcon } from "../../icons-BNEY4gO5.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/ai-sdk/Task.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { q as SpinnerIcon } from "../../icons-
|
|
2
|
+
import { q as SpinnerIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
|
-
import { t as ProviderLogo } from "../../provider-logos-
|
|
4
|
+
import { t as ProviderLogo } from "../../provider-logos-DWYY8wNz.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/extension/ChatGptSignInScreen.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { U as RefreshIcon, d as CheckIcon, f as ChevronDownIcon, l as BrainIcon, p as ChevronRightIcon } from "../../icons-
|
|
2
|
+
import { U as RefreshIcon, d as CheckIcon, f as ChevronDownIcon, l as BrainIcon, p as ChevronRightIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { Tooltip } from "../foundations/Tooltip.js";
|
|
4
4
|
import { Menu } from "../foundations/Menu.js";
|
|
5
5
|
import { c as titleCase } from "../../format-COCyV98Z.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { et as WarningIcon } from "../../icons-
|
|
1
|
+
import { et as WarningIcon } from "../../icons-BNEY4gO5.js";
|
|
2
2
|
import { Button } from "../foundations/Button.js";
|
|
3
3
|
import { Menu } from "../foundations/Menu.js";
|
|
4
4
|
import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
|
|
@@ -18,7 +18,7 @@ function AppIconRoot({ className, size = "md", variant = "artwork", ref, ...prop
|
|
|
18
18
|
function AppIconImage({ className, decoding = "async", loading = "lazy", ref, referrerPolicy = "no-referrer", ...props }) {
|
|
19
19
|
return /* @__PURE__ */ jsx(Avatar.Image, {
|
|
20
20
|
ref,
|
|
21
|
-
className: mergeBaseClassName("app-icon__image", className),
|
|
21
|
+
className: mergeBaseClassName("app-icon__image sigvelo-brand-mark sigvelo-brand-mark--colorful", className),
|
|
22
22
|
decoding,
|
|
23
23
|
loading,
|
|
24
24
|
referrerPolicy,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { d as CheckIcon } from "../../icons-
|
|
2
|
+
import { d as CheckIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
5
5
|
//#region src/components/foundations/Checkbox.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as mergeBaseClassName, t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { _ as DotIcon, d as CheckIcon } from "../../icons-
|
|
2
|
+
import { _ as DotIcon, d as CheckIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as mergeBaseClassName, t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { _ as DotIcon, d as CheckIcon } from "../../icons-
|
|
2
|
+
import { _ as DotIcon, d as CheckIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { buttonVariants } from "./Button.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { W as SearchIcon } from "../../icons-
|
|
2
|
+
import { W as SearchIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import { Field } from "./Field.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/foundations/SearchField.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { a as ArrowUpIcon, d as CheckIcon, n as ArrowDownIcon } from "../../icons-
|
|
2
|
+
import { a as ArrowUpIcon, d as CheckIcon, n as ArrowDownIcon } from "../../icons-BNEY4gO5.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Select as Select$1 } from "@base-ui/react/select";
|