@mcp-b/react-components 0.17.0 → 0.18.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/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
- package/dist/{AgentChat-CRuMi1Pb.d.ts → AgentChat-ClxViuUM.d.ts} +1 -20
- package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
- package/dist/{CodeBlock-Co1noLbC.js → CodeBlock-Bfp5PAg3.js} +9 -6
- package/dist/{CodeBlock-Dnpr88ZQ.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
- package/dist/{FileTree-B7bBsUyU.js → FileTree-3zYtrddG.js} +42 -16
- package/dist/{Message-C4eYRogZ.js → Message-BXtmfc9Q.js} +13 -20
- package/dist/{ModelSelector-BNrZlY_Y.js → ModelSelector-Cqw_qrUG.js} +15 -22
- package/dist/{PromptInput-OLfXPuHM.d.ts → PromptInput-Bdh9pqlo.d.ts} +4 -6
- package/dist/{Select-CwSqP07Y.d.ts → Select-B_13gg_J.d.ts} +2 -2
- package/dist/{Tabs-9zddXDQo.d.ts → Tabs-ColWK-XA.d.ts} +10 -2
- package/dist/{ThinkChat-DInElus-.js → ThinkChat-15EhfvYJ.js} +84 -61
- package/dist/{ThinkChatActivity-BgesTfZ4.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +4 -7
- package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
- package/dist/{Toggle-DaXpe1Lc.d.ts → Toggle-JKZ43D5S.d.ts} +1 -1
- package/dist/{ToggleGroup-yseEWkOC.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +2 -2
- package/dist/Workspace-Jez8ffUj.d.ts +274 -0
- package/dist/{WorkspaceExplorer-sZewzT2O.d.ts → WorkspaceExplorer-B9dQWNVK.d.ts} +2 -2
- package/dist/{WorkspaceFile-C8UzuSH4.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
- package/dist/{WorkspaceFileView-DNdGAEiX.js → WorkspaceFileView-C68Ub8S8.js} +120 -127
- package/dist/{WorkspaceLink-B1ykV1dS.js → WorkspaceLink-BYYeTQLf.js} +6 -27
- package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
- package/dist/{class-names-Bk-QLWWI.js → class-names-BiMDVpUo.js} +4 -1
- package/dist/components/Accordion.js +7 -2
- package/dist/components/Activity.js +2 -2
- package/dist/components/AgentActivity.d.ts +1 -1
- package/dist/components/AgentActivity.js +4 -5
- package/dist/components/AgentActivityPreview.d.ts +9 -9
- package/dist/components/AgentActivityPreview.js +8 -12
- package/dist/components/AgentAttention.d.ts +1 -1
- package/dist/components/AgentAttention.js +1 -1
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/AgentChat.js +94 -62
- package/dist/components/AgentChatMessageEditor.js +2 -2
- package/dist/components/AgentChatTurnError.js +2 -2
- package/dist/components/AgentConnection.js +3 -3
- package/dist/components/AgentMessageParts.js +1 -1
- package/dist/components/AgentToolDetail.d.ts +6 -4
- package/dist/components/AgentToolDetail.js +12 -10
- package/dist/components/AlertDialog.js +1 -1
- package/dist/components/AppTopBar.d.ts +24 -7
- package/dist/components/AppTopBar.js +32 -8
- package/dist/components/Approval.js +4 -4
- package/dist/components/Artifact.d.ts +1 -1
- package/dist/components/Artifact.js +6 -4
- package/dist/components/Autocomplete.js +1 -1
- package/dist/components/Avatar.d.ts +1 -1
- package/dist/components/Avatar.js +2 -2
- package/dist/components/Badge.js +3 -0
- package/dist/components/BrowserLiveView.js +27 -12
- package/dist/components/BrowserReplay.js +4 -3
- package/dist/components/BrowserRunPanel.js +5 -5
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Button.js +14 -11
- package/dist/components/Card.d.ts +7 -8
- package/dist/components/Card.js +19 -10
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +2 -2
- package/dist/components/ChatGptSignInScreen.js +8 -8
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/CheckboxGroup.js +1 -1
- package/dist/components/Checkpoint.js +2 -2
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.js +2 -2
- package/dist/components/Collapsible.js +2 -2
- package/dist/components/Combobox.js +1 -1
- package/dist/components/Commit.d.ts +1 -1
- package/dist/components/Commit.js +3 -3
- package/dist/components/Context.js +1 -1
- package/dist/components/ContextMenu.js +2 -2
- package/dist/components/Conversation.d.ts +1 -1
- package/dist/components/Conversation.js +5 -4
- package/dist/components/DescriptionListParts.js +1 -1
- package/dist/components/Dialog.js +1 -1
- package/dist/components/EnvironmentVariables.d.ts +1 -1
- package/dist/components/EnvironmentVariables.js +3 -3
- package/dist/components/Field.js +5 -2
- package/dist/components/Fieldset.js +1 -1
- package/dist/components/FileTree.d.ts +6 -0
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Form.js +1 -1
- package/dist/components/GithubMotionMark.js +1 -1
- package/dist/components/IconButton.d.ts +2 -3
- package/dist/components/IconButton.js +2 -1
- package/dist/components/InlineCitation.js +1 -1
- package/dist/components/Input.js +1 -1
- package/dist/components/Marker.js +1 -1
- package/dist/components/McpConnectionRequest.js +2 -2
- package/dist/components/McpServerPicker.js +2 -2
- package/dist/components/MediaPreviewCard.d.ts +103 -0
- package/dist/components/MediaPreviewCard.js +193 -0
- package/dist/components/Menu.js +1 -1
- package/dist/components/Menubar.js +2 -2
- package/dist/components/Message.d.ts +4 -1
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.d.ts +1 -1
- package/dist/components/MessageScroller.js +5 -4
- package/dist/components/Meter.js +1 -1
- package/dist/components/ModelSelector.d.ts +4 -3
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/NumberField.js +1 -1
- package/dist/components/Plan.js +2 -2
- package/dist/components/Popover.js +1 -1
- package/dist/components/PreviewCard.js +1 -1
- package/dist/components/PricingBillingToggle.js +1 -1
- package/dist/components/PricingFAQ.js +1 -1
- package/dist/components/PricingPage.js +2 -1
- package/dist/components/PricingPlanCard.js +4 -3
- package/dist/components/PricingUsageCalculator.js +2 -2
- package/dist/components/Progress.js +1 -1
- package/dist/components/PromptInput.d.ts +1 -1
- package/dist/components/PromptInput.js +33 -20
- package/dist/components/Queue.d.ts +1 -1
- package/dist/components/Queue.js +2 -3
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/Reasoning.js +3 -6
- package/dist/components/ResizableSidePanel.js +1 -1
- package/dist/components/ResponsiveSidebarShell.js +16 -10
- package/dist/components/ScrollArea.js +2 -1
- package/dist/components/SearchField.d.ts +43 -0
- package/dist/components/SearchField.js +52 -0
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Select.js +5 -6
- package/dist/components/Separator.js +1 -1
- package/dist/components/Slider.js +1 -1
- package/dist/components/Sources.js +2 -2
- package/dist/components/Stepper.js +16 -9
- package/dist/components/SubagentRunDetails.js +1 -1
- package/dist/components/SubagentRunIndicator.js +2 -2
- package/dist/components/SubagentRunList.d.ts +3 -5
- package/dist/components/SubagentRunList.js +3 -4
- package/dist/components/SubagentRunSelector.d.ts +8 -12
- package/dist/components/SubagentRunSelector.js +17 -20
- package/dist/components/Switch.d.ts +2 -2
- package/dist/components/Switch.js +4 -5
- package/dist/components/Tabs.d.ts +2 -2
- package/dist/components/Tabs.js +12 -3
- package/dist/components/Task.js +2 -2
- package/dist/components/Terminal.d.ts +2 -2
- package/dist/components/Terminal.js +5 -4
- package/dist/components/TestResults.js +10 -6
- package/dist/components/Textarea.js +1 -1
- package/dist/components/ThemeModeControl.js +1 -1
- package/dist/components/ThinkChat.d.ts +33 -20
- package/dist/components/ThinkChat.js +4 -4
- package/dist/components/ThinkChatActivity.d.ts +2 -2
- package/dist/components/ThinkChatActivity.js +8 -10
- package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/ThinkChatActivitySummary.js +7 -3
- package/dist/components/ThinkChatToolPanels.js +26 -16
- package/dist/components/ThinkExecutionDetail.js +2 -2
- package/dist/components/ThinkExecutionStatus.js +2 -2
- package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
- package/dist/components/ThinkExecutionWorkbench.js +70 -134
- package/dist/components/ThinkFullApp.d.ts +36 -35
- package/dist/components/ThinkFullApp.js +156 -109
- package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/ThinkFullAppViewSwitch.js +1 -1
- package/dist/components/ThinkRecoveryNotice.js +18 -12
- package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
- package/dist/components/ThinkRoutineBrowser.js +33 -40
- package/dist/components/ThinkRoutineDetail.d.ts +5 -2
- package/dist/components/ThinkRoutineDetail.js +4 -4
- package/dist/components/ThinkRoutineForm.d.ts +3 -2
- package/dist/components/ThinkRoutineForm.js +11 -10
- package/dist/components/ThinkRoutineLibrary.d.ts +24 -31
- package/dist/components/ThinkRoutineLibrary.js +57 -80
- package/dist/components/ThinkRoutineRuns.d.ts +3 -2
- package/dist/components/ThinkRoutineRuns.js +31 -24
- package/dist/components/ThinkThreadPicker.d.ts +17 -11
- package/dist/components/ThinkThreadPicker.js +163 -39
- package/dist/components/Toast.js +1 -1
- package/dist/components/Toggle.d.ts +1 -1
- package/dist/components/Toggle.js +9 -7
- package/dist/components/ToggleGroup.d.ts +1 -1
- package/dist/components/ToggleGroup.js +15 -13
- package/dist/components/ToolInvocation.js +1 -1
- package/dist/components/Toolbar.js +1 -1
- package/dist/components/Tooltip.d.ts +8 -1
- package/dist/components/Tooltip.js +11 -2
- package/dist/components/TransitionSurface.d.ts +27 -0
- package/dist/components/TransitionSurface.js +20 -0
- package/dist/components/WebPreview.d.ts +5 -5
- package/dist/components/WebPreview.js +68 -54
- package/dist/components/Workspace.d.ts +2 -2
- package/dist/components/Workspace.js +358 -328
- package/dist/components/WorkspaceBrowser.d.ts +4 -7
- package/dist/components/WorkspaceBrowser.js +15 -25
- package/dist/components/WorkspaceExplorer.d.ts +5 -5
- package/dist/components/WorkspaceExplorer.js +19 -32
- package/dist/components/WorkspaceFile.d.ts +1 -1
- package/dist/components/WorkspaceFileView.d.ts +14 -2
- package/dist/components/WorkspaceFileView.js +1 -1
- package/dist/components/WorkspaceHeader.d.ts +0 -8
- package/dist/components/WorkspaceHeader.js +3 -15
- package/dist/components/WorkspaceLink.d.ts +1 -1
- package/dist/components/WorkspaceLink.js +1 -1
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-CQx3LQAC.d.ts → copy-button-D7aAYA-2.d.ts} +1 -1
- package/dist/{copy-button-cYsJBauI.js → copy-button-DeK6KXEV.js} +3 -2
- package/dist/{icons--FqCZEc3.js → icons-CQJ-aMnI.js} +6 -3
- package/dist/{icons-DpUqY8Mp.d.ts → icons-CYXmvKlJ.d.ts} +17 -2
- package/dist/navigation-link-Cob7KBlM.js +19 -0
- package/dist/styles/accordion.css +4 -19
- package/dist/styles/activity.css +48 -56
- package/dist/styles/agent-activity-preview.css +2 -0
- package/dist/styles/agent-chat.css +14 -22
- package/dist/styles/alert-dialog.css +16 -18
- package/dist/styles/app-top-bar.css +17 -9
- package/dist/styles/approval.css +11 -6
- package/dist/styles/artifact.css +6 -6
- package/dist/styles/autocomplete.css +2 -1
- package/dist/styles/avatar.css +35 -30
- package/dist/styles/badge.css +10 -10
- package/dist/styles/base-ui-motion.css +94 -39
- package/dist/styles/browser-control-overlay.css +0 -1
- package/dist/styles/browser-live-view.css +39 -22
- package/dist/styles/browser-replay.css +1 -1
- package/dist/styles/browser-run-panel.css +8 -4
- package/dist/styles/button.css +36 -33
- package/dist/styles/card.css +5 -6
- package/dist/styles/chain-of-thought.css +22 -16
- package/dist/styles/checkbox.css +18 -5
- package/dist/styles/codex-model-selector.css +3 -7
- package/dist/styles/collapsible.css +10 -10
- package/dist/styles/combobox.css +3 -2
- package/dist/styles/commit.css +19 -18
- package/dist/styles/composition-motion.css +83 -0
- package/dist/styles/context-menu.css +3 -3
- package/dist/styles/context.css +11 -10
- package/dist/styles/conversation.css +18 -23
- package/dist/styles/dialog.css +15 -15
- package/dist/styles/field.css +32 -12
- package/dist/styles/file-tree.css +69 -9
- package/dist/styles/form.css +1 -1
- package/dist/styles/index.css +5 -0
- package/dist/styles/input.css +2 -2
- package/dist/styles/marker.css +14 -13
- package/dist/styles/mcp-server-picker.css +20 -17
- package/dist/styles/media-preview-card.css +160 -0
- package/dist/styles/menu.css +11 -11
- package/dist/styles/menubar.css +12 -11
- package/dist/styles/message.css +27 -21
- package/dist/styles/meter.css +2 -2
- package/dist/styles/model-selector.css +16 -14
- package/dist/styles/motion-reduction.css +29 -0
- package/dist/styles/navigation-menu.css +14 -30
- package/dist/styles/number-field.css +22 -4
- package/dist/styles/plan.css +5 -0
- package/dist/styles/popover.css +15 -16
- package/dist/styles/preview-card.css +2 -32
- package/dist/styles/progress.css +8 -3
- package/dist/styles/prompt-input.css +75 -75
- package/dist/styles/queue.css +48 -32
- package/dist/styles/radio.css +19 -12
- package/dist/styles/reasoning.css +2 -1
- package/dist/styles/recipes.css +109 -37
- package/dist/styles/resizable-side-panel.css +4 -10
- package/dist/styles/responsive-sidebar-shell.css +16 -15
- package/dist/styles/scroll-area.css +32 -15
- package/dist/styles/search-field.css +21 -0
- package/dist/styles/select.css +19 -12
- package/dist/styles/slider.css +25 -29
- package/dist/styles/sources.css +3 -3
- package/dist/styles/stepper.css +36 -26
- package/dist/styles/subagent-run.css +1 -1
- package/dist/styles/switch.css +32 -29
- package/dist/styles/tabs.css +79 -23
- package/dist/styles/task.css +13 -9
- package/dist/styles/test-results.css +29 -23
- package/dist/styles/theme-mode-control.css +8 -0
- package/dist/styles/think-execution-workbench.css +18 -15
- package/dist/styles/think-full-app.css +45 -68
- package/dist/styles/think-routine-library.css +43 -24
- package/dist/styles/think-thread-picker.css +193 -51
- package/dist/styles/toast.css +48 -27
- package/dist/styles/toggle-group.css +2 -36
- package/dist/styles/toggle.css +29 -5
- package/dist/styles/toolbar.css +25 -27
- package/dist/styles/tooltip.css +2 -32
- package/dist/styles/transition-surface.css +55 -0
- package/dist/styles/workspace-explorer.css +99 -44
- package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
- package/dist/utils/mcp-server-catalog.d.ts +132 -0
- package/dist/utils/mcp-server-catalog.js +90 -0
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +13 -7
- package/dist/Workspace-C9RFoxcu.d.ts +0 -62
- package/dist/summarize-tool-input-BUJsENSn.js +0 -12
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
3
|
+
import { buttonVariants } from "./Button.js";
|
|
3
4
|
import { Badge } from "./Badge.js";
|
|
4
5
|
import { formatThinkExecutionShortTimestamp, getThinkExecutionRunId, getThinkExecutionRunStatus, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
5
6
|
import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
|
|
6
7
|
import * as React from "react";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/ThinkRoutineRuns.tsx
|
|
9
10
|
/** Compact execution history shared by routine detail surfaces. */
|
|
10
|
-
function ThinkRoutineRuns({ className, runs, title = "Recent runs", emptyState = "Run this schedule now or wait for its next occurrence.",
|
|
11
|
+
function ThinkRoutineRuns({ className, runs, title = "Recent runs", emptyState = "Run this schedule now or wait for its next occurrence.", renderRunLink, ref, ...props }) {
|
|
11
12
|
const titleId = React.useId();
|
|
12
13
|
return /* @__PURE__ */ jsxs("section", {
|
|
13
14
|
ref,
|
|
@@ -31,30 +32,36 @@ function ThinkRoutineRuns({ className, runs, title = "Recent runs", emptyState =
|
|
|
31
32
|
children: runs.map((run) => {
|
|
32
33
|
const status = getThinkExecutionRunStatus(run);
|
|
33
34
|
const kind = isThinkSubmissionRun(run) ? "submission" : "workflow";
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(ThinkExecutionStatus, {
|
|
37
|
+
run,
|
|
38
|
+
className: "think-routine-library__run-marker"
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx("strong", { children: formatThinkExecutionShortTimestamp(run.createdAt, "Not scheduled") }) }),
|
|
41
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
42
|
+
className: "think-routine-library__run-kind",
|
|
38
43
|
variant: "ghost",
|
|
39
44
|
color: "neutral",
|
|
40
45
|
size: "sm",
|
|
46
|
+
children: kind
|
|
47
|
+
})
|
|
48
|
+
] });
|
|
49
|
+
const runClassName = buttonVariants({
|
|
50
|
+
variant: "ghost",
|
|
51
|
+
color: "neutral",
|
|
52
|
+
size: "sm",
|
|
53
|
+
className: "think-routine-library__run"
|
|
54
|
+
});
|
|
55
|
+
return /* @__PURE__ */ jsx("li", {
|
|
56
|
+
"data-status": status,
|
|
57
|
+
children: renderRunLink ? /* @__PURE__ */ jsx(NavigationLink, {
|
|
58
|
+
render: renderRunLink(run),
|
|
59
|
+
className: runClassName,
|
|
60
|
+
"aria-label": `Open ${kind} ${getThinkExecutionRunId(run)}`,
|
|
61
|
+
children: content
|
|
62
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
41
63
|
className: "think-routine-library__run",
|
|
42
|
-
|
|
43
|
-
onClick: onRunSelect ? () => onRunSelect(run) : void 0,
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ jsx(ThinkExecutionStatus, {
|
|
46
|
-
run,
|
|
47
|
-
className: "think-routine-library__run-marker"
|
|
48
|
-
}),
|
|
49
|
-
/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx("strong", { children: formatThinkExecutionShortTimestamp(run.createdAt, "Not scheduled") }) }),
|
|
50
|
-
/* @__PURE__ */ jsx(Badge, {
|
|
51
|
-
className: "think-routine-library__run-kind",
|
|
52
|
-
variant: "ghost",
|
|
53
|
-
color: "neutral",
|
|
54
|
-
size: "sm",
|
|
55
|
-
children: kind
|
|
56
|
-
})
|
|
57
|
-
]
|
|
64
|
+
children: content
|
|
58
65
|
})
|
|
59
66
|
}, `${kind}:${getThinkExecutionRunId(run)}`);
|
|
60
67
|
})
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
//#region src/components/ThinkThreadPicker.d.ts
|
|
4
4
|
interface ThinkThreadItem {
|
|
5
|
-
/** Stable child-agent/thread id
|
|
5
|
+
/** Stable child-agent/thread id used by the app-authored link's route params. */
|
|
6
6
|
id: string;
|
|
7
7
|
/** Human-readable thread title, usually generated by the parent Think agent. */
|
|
8
8
|
title: string;
|
|
@@ -31,15 +31,20 @@ interface ThinkThreadStatusIndicatorsProps {
|
|
|
31
31
|
summary: ThinkThreadStatusSummary;
|
|
32
32
|
className?: string;
|
|
33
33
|
}
|
|
34
|
-
interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "
|
|
34
|
+
interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
|
|
35
35
|
/** Threads from the parent agent, already sorted in the order the app wants to show. */
|
|
36
36
|
threads: readonly ThinkThreadItem[];
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Renders the application-owned TanStack Router Link for a thread.
|
|
39
|
+
*
|
|
40
|
+
* Put `to`, `params`, `search`, and active state on this element so they stay
|
|
41
|
+
* inferred from the consuming application's registered route tree.
|
|
42
|
+
*/
|
|
43
|
+
renderThreadLink: (thread: ThinkThreadItem) => React.ReactElement;
|
|
41
44
|
/** Optional parent-agent create action, usually `parent.stub.createThread()`. */
|
|
42
45
|
onCreate?: () => void | Promise<void>;
|
|
46
|
+
/** Optional parent-agent delete action, usually `parent.stub.deleteThread(thread.id)`. */
|
|
47
|
+
onDelete?: (thread: ThinkThreadItem) => void | Promise<void>;
|
|
43
48
|
/** Visible heading for the roster. */
|
|
44
49
|
title?: React.ReactNode;
|
|
45
50
|
/** Accessible label for the list navigation. */
|
|
@@ -54,15 +59,16 @@ declare function ThinkThreadStatusIndicators({
|
|
|
54
59
|
* Thread roster UI for sub-agent chat apps.
|
|
55
60
|
*
|
|
56
61
|
* This component does not call Think or Cloudflare RPC methods directly. Feed
|
|
57
|
-
* it from the parent agent's roster method, then
|
|
58
|
-
* child `useAgent({ sub: [...] })` name. Keep backend contract
|
|
59
|
-
* parent Think agent because
|
|
62
|
+
* it from the parent agent's roster method, then render app-owned route links
|
|
63
|
+
* that select the child `useAgent({ sub: [...] })` name. Keep backend contract
|
|
64
|
+
* notes beside the parent Think agent because
|
|
65
|
+
* `listThreads()`/`createThread()`/`deleteThread()` are app-owned.
|
|
60
66
|
*/
|
|
61
67
|
declare function ThinkThreadPicker({
|
|
62
68
|
threads,
|
|
63
|
-
|
|
64
|
-
onSelect,
|
|
69
|
+
renderThreadLink,
|
|
65
70
|
onCreate,
|
|
71
|
+
onDelete,
|
|
66
72
|
className,
|
|
67
73
|
title,
|
|
68
74
|
"aria-label": ariaLabel,
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { B as PlusIcon, G as SpinnerIcon, Z as WarningIcon, g as DotIcon, t as ArchiveIcon } from "../icons-CQJ-aMnI.js";
|
|
3
|
+
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
4
|
+
import { Button, buttonVariants } from "./Button.js";
|
|
5
|
+
import { SearchField } from "./SearchField.js";
|
|
6
|
+
import { AlertDialog } from "./AlertDialog.js";
|
|
4
7
|
import { ScrollArea } from "./ScrollArea.js";
|
|
5
|
-
import "react";
|
|
8
|
+
import * as React from "react";
|
|
6
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
10
|
//#region src/components/ThinkThreadPicker.tsx
|
|
8
11
|
function toThreadDate(value) {
|
|
@@ -49,6 +52,9 @@ function formatThreadStatus(thread) {
|
|
|
49
52
|
function isThreadBusy(status) {
|
|
50
53
|
return status === "pending" || status === "running" || status === "starting" || status === "streaming" || status === "submitted" || status === "recovering";
|
|
51
54
|
}
|
|
55
|
+
function errorMessage(error) {
|
|
56
|
+
return error instanceof Error ? error.message : String(error);
|
|
57
|
+
}
|
|
52
58
|
function summarizeThinkThreads(threads) {
|
|
53
59
|
return threads.reduce((summary, thread) => {
|
|
54
60
|
if (isThreadBusy(thread.status)) summary.running += 1;
|
|
@@ -98,12 +104,55 @@ function ThinkThreadStatusIndicators({ summary, className }) {
|
|
|
98
104
|
* Thread roster UI for sub-agent chat apps.
|
|
99
105
|
*
|
|
100
106
|
* This component does not call Think or Cloudflare RPC methods directly. Feed
|
|
101
|
-
* it from the parent agent's roster method, then
|
|
102
|
-
* child `useAgent({ sub: [...] })` name. Keep backend contract
|
|
103
|
-
* parent Think agent because
|
|
107
|
+
* it from the parent agent's roster method, then render app-owned route links
|
|
108
|
+
* that select the child `useAgent({ sub: [...] })` name. Keep backend contract
|
|
109
|
+
* notes beside the parent Think agent because
|
|
110
|
+
* `listThreads()`/`createThread()`/`deleteThread()` are app-owned.
|
|
104
111
|
*/
|
|
105
|
-
function ThinkThreadPicker({ threads,
|
|
112
|
+
function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onDelete, className, title = "Recents", "aria-label": ariaLabel = "Threads", ref, ...props }) {
|
|
106
113
|
const statusSummary = summarizeThinkThreads(threads);
|
|
114
|
+
const [query, setQuery] = React.useState("");
|
|
115
|
+
const [deleteOpen, setDeleteOpen] = React.useState(false);
|
|
116
|
+
const [deleteCandidate, setDeleteCandidate] = React.useState();
|
|
117
|
+
const [deleteBusy, setDeleteBusy] = React.useState(false);
|
|
118
|
+
const [deleteError, setDeleteError] = React.useState();
|
|
119
|
+
const deleteSucceededRef = React.useRef(false);
|
|
120
|
+
const deleteFallbackIdRef = React.useRef(void 0);
|
|
121
|
+
const threadLinkRefs = React.useRef(/* @__PURE__ */ new Map());
|
|
122
|
+
const deleteButtonRefs = React.useRef(/* @__PURE__ */ new Map());
|
|
123
|
+
const createButtonRef = React.useRef(null);
|
|
124
|
+
const navRef = React.useRef(null);
|
|
125
|
+
const normalizedQuery = query.trim().toLocaleLowerCase();
|
|
126
|
+
const visibleThreads = normalizedQuery ? threads.filter((thread) => thread.title.toLocaleLowerCase().includes(normalizedQuery)) : threads;
|
|
127
|
+
const requestDelete = (thread) => {
|
|
128
|
+
const index = threads.findIndex((candidate) => candidate.id === thread.id);
|
|
129
|
+
deleteFallbackIdRef.current = threads[index + 1]?.id ?? threads[index - 1]?.id ?? void 0;
|
|
130
|
+
deleteSucceededRef.current = false;
|
|
131
|
+
setDeleteCandidate(thread);
|
|
132
|
+
setDeleteError(void 0);
|
|
133
|
+
setDeleteOpen(true);
|
|
134
|
+
};
|
|
135
|
+
const performDelete = async () => {
|
|
136
|
+
if (!deleteCandidate || !onDelete) return;
|
|
137
|
+
setDeleteBusy(true);
|
|
138
|
+
setDeleteError(void 0);
|
|
139
|
+
try {
|
|
140
|
+
await onDelete(deleteCandidate);
|
|
141
|
+
deleteSucceededRef.current = true;
|
|
142
|
+
setDeleteOpen(false);
|
|
143
|
+
} catch (error) {
|
|
144
|
+
setDeleteError(errorMessage(error));
|
|
145
|
+
} finally {
|
|
146
|
+
setDeleteBusy(false);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const resolveDeleteFinalFocus = () => {
|
|
150
|
+
if (deleteSucceededRef.current) {
|
|
151
|
+
const fallbackId = deleteFallbackIdRef.current;
|
|
152
|
+
return (fallbackId ? threadLinkRefs.current.get(fallbackId) : void 0) ?? createButtonRef.current ?? navRef.current;
|
|
153
|
+
}
|
|
154
|
+
return (deleteCandidate ? deleteButtonRefs.current.get(deleteCandidate.id) : void 0) ?? createButtonRef.current ?? navRef.current;
|
|
155
|
+
};
|
|
107
156
|
return /* @__PURE__ */ jsxs("aside", {
|
|
108
157
|
ref,
|
|
109
158
|
className: cx("think-thread-picker", className),
|
|
@@ -116,53 +165,90 @@ function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className,
|
|
|
116
165
|
children: title
|
|
117
166
|
}), /* @__PURE__ */ jsx(ThinkThreadStatusIndicators, { summary: statusSummary })]
|
|
118
167
|
}),
|
|
168
|
+
/* @__PURE__ */ jsxs(SearchField.Root, {
|
|
169
|
+
className: "think-thread-picker__search",
|
|
170
|
+
name: "thread-search",
|
|
171
|
+
children: [/* @__PURE__ */ jsx(SearchField.Label, {
|
|
172
|
+
className: "sigvelo-visually-hidden",
|
|
173
|
+
children: "Search threads"
|
|
174
|
+
}), /* @__PURE__ */ jsx(SearchField.Control, {
|
|
175
|
+
value: query,
|
|
176
|
+
placeholder: "Search recent threads",
|
|
177
|
+
autoComplete: "off",
|
|
178
|
+
onChange: (event) => setQuery(event.currentTarget.value)
|
|
179
|
+
})]
|
|
180
|
+
}),
|
|
119
181
|
/* @__PURE__ */ jsx("nav", {
|
|
182
|
+
ref: navRef,
|
|
120
183
|
className: "think-thread-picker__nav",
|
|
121
184
|
"aria-label": ariaLabel,
|
|
185
|
+
tabIndex: -1,
|
|
122
186
|
children: /* @__PURE__ */ jsxs(ScrollArea.Root, {
|
|
123
187
|
className: "think-thread-picker__scroll",
|
|
124
188
|
children: [/* @__PURE__ */ jsx(ScrollArea.Viewport, {
|
|
125
189
|
className: "think-thread-picker__viewport",
|
|
126
190
|
"aria-label": "Thread list",
|
|
127
|
-
children:
|
|
191
|
+
children: visibleThreads.length ? /* @__PURE__ */ jsx("ul", {
|
|
128
192
|
className: "think-thread-picker__list",
|
|
129
|
-
children:
|
|
193
|
+
children: visibleThreads.map((thread) => {
|
|
130
194
|
const timestamp = formatThreadTimestamp(thread);
|
|
131
195
|
const statusLabel = formatThreadStatus(thread);
|
|
132
196
|
const busy = isThreadBusy(thread.status);
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
197
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
198
|
+
className: "think-thread-picker__item",
|
|
199
|
+
children: [/* @__PURE__ */ jsxs(NavigationLink, {
|
|
200
|
+
render: renderThreadLink(thread),
|
|
201
|
+
ref: (node) => {
|
|
202
|
+
if (node) threadLinkRefs.current.set(thread.id, node);
|
|
203
|
+
else threadLinkRefs.current.delete(thread.id);
|
|
204
|
+
},
|
|
205
|
+
className: buttonVariants({
|
|
206
|
+
variant: "ghost",
|
|
207
|
+
color: "neutral",
|
|
208
|
+
size: "sm",
|
|
209
|
+
className: "think-thread-picker__thread"
|
|
210
|
+
}),
|
|
211
|
+
"data-thread-status": thread.status,
|
|
212
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
213
|
+
className: "think-thread-picker__thread-title",
|
|
214
|
+
children: thread.title
|
|
215
|
+
}), statusLabel ? /* @__PURE__ */ jsx("span", {
|
|
216
|
+
className: "think-thread-picker__thread-status",
|
|
217
|
+
role: "img",
|
|
218
|
+
"aria-label": statusLabel,
|
|
219
|
+
title: statusLabel,
|
|
220
|
+
children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(DotIcon, {})
|
|
221
|
+
}) : timestamp?.date ? /* @__PURE__ */ jsx("time", {
|
|
222
|
+
className: "think-thread-picker__thread-time",
|
|
223
|
+
dateTime: timestamp.date.toISOString(),
|
|
224
|
+
title: timestamp.date.toLocaleString(),
|
|
225
|
+
children: timestamp.label
|
|
226
|
+
}) : timestamp ? /* @__PURE__ */ jsx("span", {
|
|
227
|
+
className: "think-thread-picker__thread-time",
|
|
228
|
+
children: timestamp.label
|
|
229
|
+
}) : null]
|
|
230
|
+
}), onDelete ? /* @__PURE__ */ jsx(Button, {
|
|
231
|
+
ref: (node) => {
|
|
232
|
+
if (node) deleteButtonRefs.current.set(thread.id, node);
|
|
233
|
+
else deleteButtonRefs.current.delete(thread.id);
|
|
234
|
+
},
|
|
235
|
+
type: "button",
|
|
236
|
+
variant: "ghost",
|
|
237
|
+
color: "neutral",
|
|
238
|
+
size: "sm",
|
|
239
|
+
iconOnly: true,
|
|
240
|
+
className: "think-thread-picker__delete",
|
|
241
|
+
"aria-label": `Delete thread ${thread.title}`,
|
|
242
|
+
"aria-haspopup": "dialog",
|
|
243
|
+
disabled: deleteBusy,
|
|
244
|
+
onClick: () => requestDelete(thread),
|
|
245
|
+
children: /* @__PURE__ */ jsx(ArchiveIcon, {})
|
|
160
246
|
}) : null]
|
|
161
|
-
}
|
|
247
|
+
}, thread.id);
|
|
162
248
|
})
|
|
163
249
|
}) : /* @__PURE__ */ jsx("p", {
|
|
164
250
|
className: "think-thread-picker__empty",
|
|
165
|
-
children: "No threads yet."
|
|
251
|
+
children: threads.length ? "No matching threads." : "No threads yet."
|
|
166
252
|
})
|
|
167
253
|
}), /* @__PURE__ */ jsx(ScrollArea.Scrollbar, {
|
|
168
254
|
orientation: "vertical",
|
|
@@ -173,6 +259,7 @@ function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className,
|
|
|
173
259
|
onCreate ? /* @__PURE__ */ jsx("div", {
|
|
174
260
|
className: "think-thread-picker__footer",
|
|
175
261
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
262
|
+
ref: createButtonRef,
|
|
176
263
|
type: "button",
|
|
177
264
|
variant: "normal",
|
|
178
265
|
color: "neutral",
|
|
@@ -181,6 +268,43 @@ function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className,
|
|
|
181
268
|
onClick: () => void onCreate(),
|
|
182
269
|
children: [/* @__PURE__ */ jsx(PlusIcon, {}), /* @__PURE__ */ jsx("span", { children: "New thread" })]
|
|
183
270
|
})
|
|
271
|
+
}) : null,
|
|
272
|
+
onDelete && deleteCandidate ? /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
273
|
+
open: deleteOpen,
|
|
274
|
+
onOpenChange: (open, eventDetails) => {
|
|
275
|
+
if (deleteBusy) {
|
|
276
|
+
eventDetails.cancel();
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
setDeleteOpen(open);
|
|
280
|
+
if (!open) setDeleteError(void 0);
|
|
281
|
+
},
|
|
282
|
+
children: /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [/* @__PURE__ */ jsx(AlertDialog.Backdrop, {}), /* @__PURE__ */ jsx(AlertDialog.Viewport, { children: /* @__PURE__ */ jsxs(AlertDialog.Popup, {
|
|
283
|
+
finalFocus: resolveDeleteFinalFocus,
|
|
284
|
+
children: [
|
|
285
|
+
/* @__PURE__ */ jsxs(AlertDialog.Title, { children: [
|
|
286
|
+
"Delete ",
|
|
287
|
+
deleteCandidate.title,
|
|
288
|
+
"?"
|
|
289
|
+
] }),
|
|
290
|
+
/* @__PURE__ */ jsx(AlertDialog.Description, { children: "This permanently deletes the conversation, its schedules, and its execution history. Any active work stops. This action cannot be undone." }),
|
|
291
|
+
deleteError ? /* @__PURE__ */ jsxs("p", {
|
|
292
|
+
className: "think-thread-picker__delete-error",
|
|
293
|
+
role: "alert",
|
|
294
|
+
children: [/* @__PURE__ */ jsx(WarningIcon, {}), /* @__PURE__ */ jsx("span", { children: deleteError })]
|
|
295
|
+
}) : null,
|
|
296
|
+
/* @__PURE__ */ jsxs(AlertDialog.Footer, { children: [/* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
297
|
+
disabled: deleteBusy,
|
|
298
|
+
children: "Cancel"
|
|
299
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
300
|
+
type: "button",
|
|
301
|
+
color: "destructive",
|
|
302
|
+
disabled: deleteBusy,
|
|
303
|
+
onClick: () => void performDelete(),
|
|
304
|
+
children: [deleteBusy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : null, deleteBusy ? "Deleting…" : "Delete thread"]
|
|
305
|
+
})] })
|
|
306
|
+
]
|
|
307
|
+
}) })] })
|
|
184
308
|
}) : null
|
|
185
309
|
]
|
|
186
310
|
});
|
package/dist/components/Toast.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as toggleVariants, n as ToggleProps, r as ToggleVariantsOptions, t as Toggle } from "../Toggle-
|
|
1
|
+
import { i as toggleVariants, n as ToggleProps, r as ToggleVariantsOptions, t as Toggle } from "../Toggle-JKZ43D5S.js";
|
|
2
2
|
export { Toggle, ToggleProps, ToggleVariantsOptions, toggleVariants };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { n as mergeBaseClassName } from "../class-names-
|
|
1
|
+
import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
5
5
|
//#region src/components/Toggle.tsx
|
|
6
|
-
function toggleVariants({ variant = "default", size = "
|
|
6
|
+
function toggleVariants({ variant = "default", size = "md", className } = {}) {
|
|
7
7
|
return [
|
|
8
8
|
"toggle",
|
|
9
9
|
variant === "outline" && "toggle--outline",
|
|
10
|
-
size !== "
|
|
10
|
+
size !== "md" && `toggle--${size}`,
|
|
11
11
|
className
|
|
12
12
|
].filter(Boolean).join(" ");
|
|
13
13
|
}
|
|
@@ -52,13 +52,15 @@ function toggleVariants({ variant = "default", size = "default", className } = {
|
|
|
52
52
|
* @see {@link https://base-ui.com/react/components/toggle | Base UI Toggle}
|
|
53
53
|
*/
|
|
54
54
|
function Toggle({ className, variant, size, ref, ...props }) {
|
|
55
|
+
const classes = mergeBaseClassName(toggleVariants({
|
|
56
|
+
variant,
|
|
57
|
+
size
|
|
58
|
+
}), className);
|
|
55
59
|
return /* @__PURE__ */ jsx(Toggle$1, {
|
|
56
60
|
ref,
|
|
57
61
|
"data-slot": "toggle",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
size
|
|
61
|
-
}), className),
|
|
62
|
+
"data-size": size ?? "md",
|
|
63
|
+
className: classes,
|
|
62
64
|
...props
|
|
63
65
|
});
|
|
64
66
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ToggleGroupItemProps, r as ToggleGroupProps, t as ToggleGroup } from "../ToggleGroup-
|
|
1
|
+
import { n as ToggleGroupItemProps, r as ToggleGroupProps, t as ToggleGroup } from "../ToggleGroup-DNd6cDJZ.js";
|
|
2
2
|
export { ToggleGroup, ToggleGroupItemProps, ToggleGroupProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as mergeBaseClassName } from "../class-names-
|
|
1
|
+
import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { toggleVariants } from "./Toggle.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -7,12 +7,9 @@ import { Toggle } from "@base-ui/react/toggle";
|
|
|
7
7
|
//#region src/components/ToggleGroup.tsx
|
|
8
8
|
const ToggleGroupContext = React.createContext({
|
|
9
9
|
variant: "default",
|
|
10
|
-
size: "
|
|
10
|
+
size: "md",
|
|
11
11
|
spacing: 0
|
|
12
12
|
});
|
|
13
|
-
function normalizeSize(size) {
|
|
14
|
-
return size === "md" ? "default" : size;
|
|
15
|
-
}
|
|
16
13
|
/**
|
|
17
14
|
* A toggle group component for selecting one or multiple options.
|
|
18
15
|
*
|
|
@@ -39,7 +36,6 @@ function normalizeSize(size) {
|
|
|
39
36
|
* @see {@link https://base-ui.com/react/components/toggle-group | Base UI Toggle Group}
|
|
40
37
|
*/
|
|
41
38
|
function ToggleGroupRoot({ size = "md", spacing = 0, variant = "default", className, children, style, ref, ...props }) {
|
|
42
|
-
const normalizedSize = normalizeSize(size);
|
|
43
39
|
const gap = `${spacing * .25}rem`;
|
|
44
40
|
const groupStyle = typeof style === "function" ? (state) => ({
|
|
45
41
|
...style(state),
|
|
@@ -48,21 +44,27 @@ function ToggleGroupRoot({ size = "md", spacing = 0, variant = "default", classN
|
|
|
48
44
|
...style,
|
|
49
45
|
gap
|
|
50
46
|
};
|
|
47
|
+
const classes = mergeBaseClassName(["toggle-group", size !== "md" && `toggle-group--${size}`].filter(Boolean).join(" "), className);
|
|
48
|
+
const contextValue = React.useMemo(() => ({
|
|
49
|
+
variant,
|
|
50
|
+
size,
|
|
51
|
+
spacing
|
|
52
|
+
}), [
|
|
53
|
+
size,
|
|
54
|
+
spacing,
|
|
55
|
+
variant
|
|
56
|
+
]);
|
|
51
57
|
return /* @__PURE__ */ jsx(ToggleGroup$1, {
|
|
52
58
|
ref,
|
|
53
|
-
"data-size":
|
|
59
|
+
"data-size": size,
|
|
54
60
|
"data-slot": "toggle-group",
|
|
55
61
|
"data-spacing": spacing,
|
|
56
62
|
"data-variant": variant,
|
|
57
|
-
className:
|
|
63
|
+
className: classes,
|
|
58
64
|
style: groupStyle,
|
|
59
65
|
...props,
|
|
60
66
|
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, {
|
|
61
|
-
value:
|
|
62
|
-
variant,
|
|
63
|
-
size: normalizedSize,
|
|
64
|
-
spacing
|
|
65
|
-
},
|
|
67
|
+
value: contextValue,
|
|
66
68
|
children
|
|
67
69
|
})
|
|
68
70
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Activity, ActivityContent, ActivityPanel, ActivityTrigger } from "./Activity.js";
|
|
2
2
|
import { getToolDisplayName, isToolPartFailed, isToolPartWorking } from "./ThinkChatToolParts.js";
|
|
3
|
-
import { t as summarizeToolInput } from "../summarize-tool-input-
|
|
3
|
+
import { t as summarizeToolInput } from "../summarize-tool-input-CqTcGRYy.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { getToolName } from "ai";
|
|
6
6
|
import { getToolInput, getToolOutput, getToolPartState } from "@cloudflare/think/react";
|
|
@@ -40,6 +40,13 @@ declare function TooltipProvider({
|
|
|
40
40
|
...props
|
|
41
41
|
}: TooltipProviderProps): React.JSX.Element;
|
|
42
42
|
declare function TooltipTrigger(props: TooltipTriggerProps): React.JSX.Element;
|
|
43
|
+
declare function TooltipPositioner({
|
|
44
|
+
className,
|
|
45
|
+
ref,
|
|
46
|
+
...props
|
|
47
|
+
}: TooltipPositionerProps & {
|
|
48
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
49
|
+
}): React.JSX.Element;
|
|
43
50
|
declare function TooltipPopup({
|
|
44
51
|
className,
|
|
45
52
|
ref,
|
|
@@ -77,7 +84,7 @@ declare const Tooltip: {
|
|
|
77
84
|
Provider: typeof TooltipProvider;
|
|
78
85
|
Trigger: typeof TooltipTrigger;
|
|
79
86
|
Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TooltipPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
80
|
-
Positioner:
|
|
87
|
+
Positioner: typeof TooltipPositioner;
|
|
81
88
|
Popup: typeof TooltipPopup;
|
|
82
89
|
Viewport: typeof TooltipViewport;
|
|
83
90
|
Arrow: typeof TooltipArrow;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as mergeBaseClassName } from "../class-names-
|
|
1
|
+
import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
@@ -37,6 +37,15 @@ function TooltipTrigger(props) {
|
|
|
37
37
|
...props
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
function TooltipPositioner({ className, ref, ...props }) {
|
|
41
|
+
const classes = mergeBaseClassName(["tooltip__positioner", "base-ui-positioner"].filter(Boolean).join(" "), className);
|
|
42
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
|
|
43
|
+
ref,
|
|
44
|
+
"data-slot": "tooltip-positioner",
|
|
45
|
+
className: classes,
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
40
49
|
function TooltipPopup({ className, ref, role = "tooltip", ...props }) {
|
|
41
50
|
const classes = mergeBaseClassName(["tooltip__popup", "base-ui-popup"].filter(Boolean).join(" "), className);
|
|
42
51
|
return /* @__PURE__ */ jsx(Tooltip$1.Popup, {
|
|
@@ -80,7 +89,7 @@ const Tooltip = {
|
|
|
80
89
|
Provider: TooltipProvider,
|
|
81
90
|
Trigger: TooltipTrigger,
|
|
82
91
|
Portal: Tooltip$1.Portal,
|
|
83
|
-
Positioner:
|
|
92
|
+
Positioner: TooltipPositioner,
|
|
84
93
|
Popup: TooltipPopup,
|
|
85
94
|
Viewport: TooltipViewport,
|
|
86
95
|
Arrow: TooltipArrow
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/TransitionSurface.d.ts
|
|
4
|
+
type TransitionSurfaceVariant = "fade" | "scale" | "slide-block" | "slide-inline";
|
|
5
|
+
interface TransitionSurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* The restrained entrance and hidden-state treatment applied to the surface.
|
|
8
|
+
* Pair separate surfaces around Suspense fallback and resolved content.
|
|
9
|
+
* @default "fade"
|
|
10
|
+
*/
|
|
11
|
+
variant?: TransitionSurfaceVariant;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A lightweight presence surface for content inserted by React or revealed
|
|
15
|
+
* from `hidden`. CSS owns its motion through `@starting-style` and discrete
|
|
16
|
+
* transitions; this component does not own data loading or Suspense state.
|
|
17
|
+
*/
|
|
18
|
+
declare function TransitionSurface({
|
|
19
|
+
className,
|
|
20
|
+
variant,
|
|
21
|
+
ref,
|
|
22
|
+
...props
|
|
23
|
+
}: TransitionSurfaceProps & {
|
|
24
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { TransitionSurface, TransitionSurfaceProps, TransitionSurfaceVariant };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/TransitionSurface.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A lightweight presence surface for content inserted by React or revealed
|
|
7
|
+
* from `hidden`. CSS owns its motion through `@starting-style` and discrete
|
|
8
|
+
* transitions; this component does not own data loading or Suspense state.
|
|
9
|
+
*/
|
|
10
|
+
function TransitionSurface({ className, variant = "fade", ref, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", {
|
|
12
|
+
ref,
|
|
13
|
+
"data-slot": "transition-surface",
|
|
14
|
+
"data-variant": variant,
|
|
15
|
+
className: cx("transition-surface", className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { TransitionSurface };
|