@mcp-b/react-components 0.17.0 → 0.19.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-Bb-IPBc_.js} +9 -6
- package/dist/{CodeBlock-Dnpr88ZQ.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
- package/dist/{FileTree-B7bBsUyU.js → FileTree-CUlXfnmc.js} +42 -16
- package/dist/{Message-C4eYRogZ.js → Message-rZEaaD8Q.js} +13 -20
- package/dist/{ModelSelector-BNrZlY_Y.js → ModelSelector-4GsCWcZV.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-CEdArlOT.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 +35 -15
- 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 +31 -18
- 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-cYsJBauI.js → copy-button-BtRwhRks.js} +3 -2
- package/dist/{copy-button-CQx3LQAC.d.ts → copy-button-D7aAYA-2.d.ts} +1 -1
- package/dist/{icons--FqCZEc3.js → icons-DKXiSepE.js} +7 -3
- package/dist/{icons-DpUqY8Mp.d.ts → icons-DkRtZmvT.d.ts} +22 -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 +46 -8
- 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 +87 -70
- 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/codex-model-catalog.d.ts +2 -8
- package/dist/utils/codex-model-catalog.js +2 -16
- package/dist/utils/mcp-server-catalog.d.ts +139 -0
- package/dist/utils/mcp-server-catalog.js +98 -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,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Q as WarningIcon, b as EyeIcon, et as XIcon, k as MaximizeIcon, m as CodeIcon, u as CheckIcon, v as DownloadIcon } from "./icons-DKXiSepE.js";
|
|
2
|
+
import { t as NavigationLink } from "./navigation-link-Cob7KBlM.js";
|
|
3
|
+
import { buttonVariants } from "./components/Button.js";
|
|
4
|
+
import { c as useWorkspaceNavigationContext, s as useWorkspaceNavigationRestoration } from "./WorkspaceLink-BYYeTQLf.js";
|
|
5
|
+
import { f as MessageResponse, m as createWorkspaceRehypePlugins } from "./Message-rZEaaD8Q.js";
|
|
6
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-Bb-IPBc_.js";
|
|
5
7
|
import { AppTopBar } from "./components/AppTopBar.js";
|
|
6
|
-
import { WorkspaceHeader } from "./components/WorkspaceHeader.js";
|
|
7
8
|
import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/WorkspaceFile.js";
|
|
9
|
+
import { WorkspaceHeader } from "./components/WorkspaceHeader.js";
|
|
8
10
|
import * as React from "react";
|
|
9
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
12
|
import { defaultRehypePlugins } from "streamdown";
|
|
@@ -55,25 +57,14 @@ function resolveLightboxTheme(element) {
|
|
|
55
57
|
/** Create component-owned object URLs for bytes and revoke them on replacement. */
|
|
56
58
|
function useWorkspaceAssetUrl(asset, mimeType) {
|
|
57
59
|
const [objectUrl, setObjectUrl] = React.useState(null);
|
|
58
|
-
const assetTokensRef = React.useRef(/* @__PURE__ */ new WeakMap());
|
|
59
|
-
const nextAssetTokenRef = React.useRef(0);
|
|
60
|
-
let assetToken = null;
|
|
61
|
-
if (asset?.kind === "data") {
|
|
62
|
-
assetToken = assetTokensRef.current.get(asset) ?? null;
|
|
63
|
-
if (assetToken === null) {
|
|
64
|
-
assetToken = nextAssetTokenRef.current + 1;
|
|
65
|
-
nextAssetTokenRef.current = assetToken;
|
|
66
|
-
assetTokensRef.current.set(asset, assetToken);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
60
|
React.useEffect(() => {
|
|
70
|
-
if (!asset || asset.kind !== "data"
|
|
61
|
+
if (!asset || asset.kind !== "data") {
|
|
71
62
|
setObjectUrl(null);
|
|
72
63
|
return;
|
|
73
64
|
}
|
|
74
65
|
if (typeof URL === "undefined" || typeof URL.createObjectURL !== "function" || typeof Blob === "undefined") {
|
|
75
66
|
setObjectUrl({
|
|
76
|
-
|
|
67
|
+
asset,
|
|
77
68
|
url: null,
|
|
78
69
|
downloadUrl: null,
|
|
79
70
|
error: "This browser cannot prepare a local preview."
|
|
@@ -87,7 +78,7 @@ function useWorkspaceAssetUrl(asset, mimeType) {
|
|
|
87
78
|
url = URL.createObjectURL(previewBlob);
|
|
88
79
|
downloadUrl = mimeType === SVG_MIME_TYPE ? URL.createObjectURL(new Blob([previewBlob], { type: "application/octet-stream" })) : url;
|
|
89
80
|
setObjectUrl({
|
|
90
|
-
|
|
81
|
+
asset,
|
|
91
82
|
url,
|
|
92
83
|
downloadUrl,
|
|
93
84
|
error: null
|
|
@@ -96,7 +87,7 @@ function useWorkspaceAssetUrl(asset, mimeType) {
|
|
|
96
87
|
if (url) URL.revokeObjectURL(url);
|
|
97
88
|
if (downloadUrl && downloadUrl !== url) URL.revokeObjectURL(downloadUrl);
|
|
98
89
|
setObjectUrl({
|
|
99
|
-
|
|
90
|
+
asset,
|
|
100
91
|
url: null,
|
|
101
92
|
downloadUrl: null,
|
|
102
93
|
error: "This file could not be prepared for preview."
|
|
@@ -107,11 +98,7 @@ function useWorkspaceAssetUrl(asset, mimeType) {
|
|
|
107
98
|
if (url) URL.revokeObjectURL(url);
|
|
108
99
|
if (downloadUrl && downloadUrl !== url) URL.revokeObjectURL(downloadUrl);
|
|
109
100
|
};
|
|
110
|
-
}, [
|
|
111
|
-
asset,
|
|
112
|
-
assetToken,
|
|
113
|
-
mimeType
|
|
114
|
-
]);
|
|
101
|
+
}, [asset, mimeType]);
|
|
115
102
|
if (!asset) return {
|
|
116
103
|
url: null,
|
|
117
104
|
downloadUrl: null,
|
|
@@ -125,7 +112,7 @@ function useWorkspaceAssetUrl(asset, mimeType) {
|
|
|
125
112
|
error: url ? null : "The host returned an unsupported asset URL."
|
|
126
113
|
};
|
|
127
114
|
}
|
|
128
|
-
if (
|
|
115
|
+
if (objectUrl?.asset !== asset) return {
|
|
129
116
|
url: null,
|
|
130
117
|
downloadUrl: null,
|
|
131
118
|
error: null
|
|
@@ -221,12 +208,6 @@ function WorkspaceImagePreview({ asset, fileName, media, url }) {
|
|
|
221
208
|
const [loadFailed, setLoadFailed] = React.useState(false);
|
|
222
209
|
const figureRef = React.useRef(null);
|
|
223
210
|
const [lightboxTheme, setLightboxTheme] = React.useState();
|
|
224
|
-
React.useEffect(() => {
|
|
225
|
-
setDimensions(null);
|
|
226
|
-
setHasLoaded(false);
|
|
227
|
-
setLoadFailed(false);
|
|
228
|
-
setOpen(false);
|
|
229
|
-
}, [url]);
|
|
230
211
|
const alt = asset.alt?.trim() || fileName;
|
|
231
212
|
const slide = {
|
|
232
213
|
src: url,
|
|
@@ -259,7 +240,6 @@ function WorkspaceImagePreview({ asset, fileName, media, url }) {
|
|
|
259
240
|
className: "workspace-explorer__image",
|
|
260
241
|
src: url,
|
|
261
242
|
alt,
|
|
262
|
-
role: "img",
|
|
263
243
|
width: dimensions?.width,
|
|
264
244
|
height: dimensions?.height,
|
|
265
245
|
onLoad: (event) => {
|
|
@@ -358,11 +338,6 @@ function WorkspaceAudioPreview({ asset, fileName, media, url }) {
|
|
|
358
338
|
const [loadFailed, setLoadFailed] = React.useState(false);
|
|
359
339
|
const tracks = safeTracks(asset.tracks);
|
|
360
340
|
const transcriptUrl = safeAssetUrl(asset.transcriptUrl);
|
|
361
|
-
React.useEffect(() => {
|
|
362
|
-
setDuration(null);
|
|
363
|
-
setMetadataLoaded(false);
|
|
364
|
-
setLoadFailed(false);
|
|
365
|
-
}, [url]);
|
|
366
341
|
return /* @__PURE__ */ jsxs("figure", {
|
|
367
342
|
className: "workspace-explorer__media-figure workspace-explorer__media-figure--audio",
|
|
368
343
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -417,12 +392,6 @@ function WorkspaceVideoPreview({ asset, fileName, media, url }) {
|
|
|
417
392
|
const tracks = safeTracks(asset.tracks);
|
|
418
393
|
const posterUrl = safeAssetUrl(asset.posterUrl) ?? void 0;
|
|
419
394
|
const transcriptUrl = safeAssetUrl(asset.transcriptUrl);
|
|
420
|
-
React.useEffect(() => {
|
|
421
|
-
setDuration(null);
|
|
422
|
-
setDimensions(null);
|
|
423
|
-
setMetadataLoaded(false);
|
|
424
|
-
setLoadFailed(false);
|
|
425
|
-
}, [url]);
|
|
426
395
|
return /* @__PURE__ */ jsxs("figure", {
|
|
427
396
|
className: "workspace-explorer__media-figure workspace-explorer__media-figure--video",
|
|
428
397
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -484,15 +453,16 @@ function WorkspaceMediaPreview(props) {
|
|
|
484
453
|
const { onScroll } = props;
|
|
485
454
|
return /* @__PURE__ */ jsxs("div", {
|
|
486
455
|
className: "workspace-explorer__media-scroll",
|
|
456
|
+
"data-workspace-file-content": "",
|
|
487
457
|
"data-workspace-focus-target": "",
|
|
488
458
|
"data-workspace-scroll": "",
|
|
489
459
|
onScroll,
|
|
490
460
|
tabIndex: -1,
|
|
491
461
|
children: [
|
|
492
|
-
props.media.kind === "image" ? /* @__PURE__ */ jsx(WorkspaceImagePreview, { ...props }) : null,
|
|
462
|
+
props.media.kind === "image" ? /* @__PURE__ */ jsx(WorkspaceImagePreview, { ...props }, props.url) : null,
|
|
493
463
|
props.media.kind === "pdf" ? /* @__PURE__ */ jsx(WorkspacePdfPreview, { ...props }) : null,
|
|
494
|
-
props.media.kind === "audio" ? /* @__PURE__ */ jsx(WorkspaceAudioPreview, { ...props }) : null,
|
|
495
|
-
props.media.kind === "video" ? /* @__PURE__ */ jsx(WorkspaceVideoPreview, { ...props }) : null
|
|
464
|
+
props.media.kind === "audio" ? /* @__PURE__ */ jsx(WorkspaceAudioPreview, { ...props }, props.url) : null,
|
|
465
|
+
props.media.kind === "video" ? /* @__PURE__ */ jsx(WorkspaceVideoPreview, { ...props }, props.url) : null
|
|
496
466
|
]
|
|
497
467
|
});
|
|
498
468
|
}
|
|
@@ -513,9 +483,13 @@ function createWorkspaceHeading(tag, prefix) {
|
|
|
513
483
|
});
|
|
514
484
|
};
|
|
515
485
|
}
|
|
516
|
-
/**
|
|
517
|
-
function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actions, onRefresh }) {
|
|
518
|
-
const [
|
|
486
|
+
/** Workspace file preview composed from CodeBlock and AppTopBar. */
|
|
487
|
+
function WorkspaceFileView({ appearance = "contained", file, path, isLoading, isRefreshing, leading, actions, showSkillIdentity = true, onRefresh }) {
|
|
488
|
+
const [markdownViewState, setMarkdownViewState] = React.useState(() => ({
|
|
489
|
+
path,
|
|
490
|
+
view: "preview"
|
|
491
|
+
}));
|
|
492
|
+
const markdownView = markdownViewState.path === path ? markdownViewState.view : "preview";
|
|
519
493
|
const isMarkdown = isWorkspaceMarkdownPath(path);
|
|
520
494
|
const workspaceNavigation = useWorkspaceNavigationContext();
|
|
521
495
|
const restoration = useWorkspaceNavigationRestoration();
|
|
@@ -527,11 +501,7 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
|
|
|
527
501
|
const scrollRef = React.useRef(null);
|
|
528
502
|
const handledFocusRequestRef = React.useRef(null);
|
|
529
503
|
const headingPrefix = React.useId().replaceAll(":", "");
|
|
530
|
-
const workspaceRehypePlugins = React.useMemo(() => createFileViewRehypePlugins(workspaceNavigation), [
|
|
531
|
-
workspaceNavigation?.base.kind,
|
|
532
|
-
workspaceNavigation?.base.path,
|
|
533
|
-
workspaceNavigation?.root
|
|
534
|
-
]);
|
|
504
|
+
const workspaceRehypePlugins = React.useMemo(() => createFileViewRehypePlugins(workspaceNavigation), [workspaceNavigation]);
|
|
535
505
|
const media = inferWorkspaceMedia(path, file?.asset?.mimeType ?? file?.info?.mimeType);
|
|
536
506
|
const assetUrl = useWorkspaceAssetUrl(file?.asset, media?.mimeType ?? "application/octet-stream");
|
|
537
507
|
const isPreparingAsset = Boolean(file?.asset && !assetUrl.url && !assetUrl.error);
|
|
@@ -546,9 +516,6 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
|
|
|
546
516
|
h5: createWorkspaceHeading("h5", headingPrefix),
|
|
547
517
|
h6: createWorkspaceHeading("h6", headingPrefix)
|
|
548
518
|
}), [headingPrefix]);
|
|
549
|
-
React.useEffect(() => {
|
|
550
|
-
setMarkdownView("preview");
|
|
551
|
-
}, [path]);
|
|
552
519
|
React.useEffect(() => {
|
|
553
520
|
if (!entryKey || isLoading || isPreparingAsset || !file) return;
|
|
554
521
|
const focusRequest = JSON.stringify([
|
|
@@ -594,6 +561,19 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
|
|
|
594
561
|
downloadUrl: assetUrl.downloadUrl,
|
|
595
562
|
allowOpen: media?.mimeType !== "image/svg+xml"
|
|
596
563
|
}) : null;
|
|
564
|
+
const closeAction = workspaceNavigation ? /* @__PURE__ */ jsx(NavigationLink, {
|
|
565
|
+
"aria-label": "Close file",
|
|
566
|
+
className: buttonVariants({
|
|
567
|
+
color: "neutral",
|
|
568
|
+
variant: "ghost",
|
|
569
|
+
size: "sm",
|
|
570
|
+
className: "workspace-explorer__file-close"
|
|
571
|
+
}),
|
|
572
|
+
"data-icon-only": "",
|
|
573
|
+
"data-slot": "button",
|
|
574
|
+
render: workspaceNavigation.navigation.renderLink({ kind: "files" }),
|
|
575
|
+
children: /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true" })
|
|
576
|
+
}) : null;
|
|
597
577
|
const headerProps = {
|
|
598
578
|
path,
|
|
599
579
|
leading,
|
|
@@ -601,21 +581,15 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
|
|
|
601
581
|
actions,
|
|
602
582
|
assetActions,
|
|
603
583
|
/* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
604
|
-
label: "Preview Markdown",
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
label: "View Markdown source",
|
|
611
|
-
"aria-pressed": markdownView === "source",
|
|
612
|
-
onClick: () => setMarkdownView("source"),
|
|
613
|
-
children: /* @__PURE__ */ jsx(CodeIcon, { "aria-hidden": "true" })
|
|
584
|
+
label: markdownView === "preview" ? "View Markdown source" : "Preview Markdown",
|
|
585
|
+
onClick: () => setMarkdownViewState({
|
|
586
|
+
path,
|
|
587
|
+
view: markdownView === "preview" ? "source" : "preview"
|
|
588
|
+
}),
|
|
589
|
+
children: markdownView === "preview" ? /* @__PURE__ */ jsx(CodeIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true" })
|
|
614
590
|
})
|
|
615
591
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [actions, assetActions] }),
|
|
616
592
|
isRefreshing,
|
|
617
|
-
onBack: workspaceNavigation?.navigation.canGoBack ? () => workspaceNavigation.navigation.goBack() : void 0,
|
|
618
|
-
onForward: workspaceNavigation?.navigation.canGoForward ? () => workspaceNavigation.navigation.goForward() : void 0,
|
|
619
593
|
onRefresh
|
|
620
594
|
};
|
|
621
595
|
if (isLoading || !file || file.error || assetUrl.error || isPreparingAsset || file.asset && !media || !file.asset && (file.content === null || file.content.length === 0)) {
|
|
@@ -636,27 +610,38 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
|
|
|
636
610
|
return /* @__PURE__ */ jsxs("div", {
|
|
637
611
|
ref: fileViewRef,
|
|
638
612
|
className: "workspace-explorer__file",
|
|
613
|
+
"data-appearance": appearance,
|
|
639
614
|
"data-workspace-restoration-scope": "file",
|
|
640
|
-
children: [
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
615
|
+
children: [
|
|
616
|
+
/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }),
|
|
617
|
+
closeAction,
|
|
618
|
+
/* @__PURE__ */ jsx("div", {
|
|
619
|
+
className: "workspace-explorer__empty",
|
|
620
|
+
"data-workspace-file-content": "",
|
|
621
|
+
"data-workspace-focus-target": "",
|
|
622
|
+
role,
|
|
623
|
+
children: message
|
|
624
|
+
})
|
|
625
|
+
]
|
|
646
626
|
});
|
|
647
627
|
}
|
|
648
628
|
if (file.asset && media && assetUrl.url) return /* @__PURE__ */ jsxs("div", {
|
|
649
629
|
ref: fileViewRef,
|
|
650
630
|
className: "workspace-explorer__file",
|
|
631
|
+
"data-appearance": appearance,
|
|
651
632
|
"data-workspace-restoration-scope": "file",
|
|
652
|
-
children: [
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
633
|
+
children: [
|
|
634
|
+
/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }),
|
|
635
|
+
closeAction,
|
|
636
|
+
/* @__PURE__ */ jsx(WorkspaceMediaPreview, {
|
|
637
|
+
asset: file.asset,
|
|
638
|
+
fileName: file.name,
|
|
639
|
+
media,
|
|
640
|
+
url: assetUrl.url,
|
|
641
|
+
downloadUrl: assetUrl.downloadUrl,
|
|
642
|
+
onScroll: handleScroll
|
|
643
|
+
})
|
|
644
|
+
]
|
|
660
645
|
});
|
|
661
646
|
if (file.content === null) return null;
|
|
662
647
|
if (isMarkdown && markdownView === "preview") {
|
|
@@ -671,64 +656,72 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
|
|
|
671
656
|
return /* @__PURE__ */ jsxs("div", {
|
|
672
657
|
ref: fileViewRef,
|
|
673
658
|
className: "workspace-explorer__file",
|
|
659
|
+
"data-appearance": appearance,
|
|
674
660
|
"data-workspace-restoration-scope": "file",
|
|
675
|
-
children: [
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
/* @__PURE__ */ jsx("
|
|
691
|
-
className: "workspace-explorer__skill-
|
|
692
|
-
children:
|
|
693
|
-
}),
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
661
|
+
children: [
|
|
662
|
+
/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }),
|
|
663
|
+
closeAction,
|
|
664
|
+
/* @__PURE__ */ jsx("div", {
|
|
665
|
+
ref: scrollRef,
|
|
666
|
+
className: "workspace-explorer__markdown-scroll",
|
|
667
|
+
"data-workspace-file-content": "",
|
|
668
|
+
"data-workspace-scroll": "",
|
|
669
|
+
onScroll: handleScroll,
|
|
670
|
+
children: /* @__PURE__ */ jsxs("article", {
|
|
671
|
+
className: "workspace-explorer__markdown",
|
|
672
|
+
children: [skill ? /* @__PURE__ */ jsxs("header", {
|
|
673
|
+
className: "workspace-explorer__skill",
|
|
674
|
+
"data-skill-identity": showSkillIdentity ? "" : void 0,
|
|
675
|
+
children: [
|
|
676
|
+
showSkillIdentity ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
677
|
+
className: "workspace-explorer__skill-kicker",
|
|
678
|
+
children: "Agent Skill"
|
|
679
|
+
}), skill.parsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
680
|
+
/* @__PURE__ */ jsx("p", {
|
|
681
|
+
className: "workspace-explorer__skill-name",
|
|
682
|
+
children: skill.parsed.properties.name
|
|
683
|
+
}),
|
|
684
|
+
/* @__PURE__ */ jsx("p", {
|
|
685
|
+
className: "workspace-explorer__skill-description",
|
|
686
|
+
children: skill.parsed.properties.description
|
|
687
|
+
}),
|
|
688
|
+
/* @__PURE__ */ jsxs("dl", {
|
|
689
|
+
className: "workspace-explorer__skill-metadata",
|
|
690
|
+
children: [skill.parsed.properties.compatibility ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Compatibility" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.compatibility })] }) : null, skill.parsed.properties.allowedTools ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Allowed tools" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.allowedTools })] }) : null]
|
|
691
|
+
})
|
|
692
|
+
] }) : null] }) : null,
|
|
693
|
+
/* @__PURE__ */ jsxs("div", {
|
|
694
|
+
className: "workspace-explorer__skill-status",
|
|
695
|
+
"data-invalid": skill.validationErrors.length > 0 ? "" : void 0,
|
|
696
|
+
children: [skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }), skill.validationErrors.length > 0 ? `${skill.validationErrors.length.toLocaleString()} validation ${skill.validationErrors.length === 1 ? "issue" : "issues"}` : "Valid Agent Skill"]
|
|
697
697
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
-
className: "workspace-explorer__skill-
|
|
700
|
-
children:
|
|
701
|
-
})
|
|
702
|
-
]
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
"data-invalid": skill.validationErrors.length > 0 ? "" : void 0,
|
|
706
|
-
children: [skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }), skill.validationErrors.length > 0 ? `${skill.validationErrors.length.toLocaleString()} validation ${skill.validationErrors.length === 1 ? "issue" : "issues"}` : "Valid Agent Skill"]
|
|
707
|
-
}),
|
|
708
|
-
skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
709
|
-
className: "workspace-explorer__skill-errors",
|
|
710
|
-
children: skill.validationErrors.map((error) => /* @__PURE__ */ jsx("li", { children: error }, error))
|
|
711
|
-
}) : null
|
|
712
|
-
]
|
|
713
|
-
}) : null, response]
|
|
698
|
+
skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
699
|
+
className: "workspace-explorer__skill-errors",
|
|
700
|
+
children: skill.validationErrors.map((error) => /* @__PURE__ */ jsx("li", { children: error }, error))
|
|
701
|
+
}) : null
|
|
702
|
+
]
|
|
703
|
+
}) : null, response]
|
|
704
|
+
})
|
|
714
705
|
})
|
|
715
|
-
|
|
706
|
+
]
|
|
716
707
|
});
|
|
717
708
|
}
|
|
718
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
719
710
|
ref: fileViewRef,
|
|
720
711
|
className: "workspace-explorer__file",
|
|
712
|
+
"data-appearance": appearance,
|
|
721
713
|
"data-workspace-restoration-scope": "file",
|
|
722
|
-
children: /* @__PURE__ */ jsxs(CodeBlock, {
|
|
714
|
+
children: [closeAction, /* @__PURE__ */ jsxs(CodeBlock, {
|
|
723
715
|
className: "workspace-explorer__code",
|
|
724
716
|
code: file.content,
|
|
717
|
+
"data-workspace-file-content": "",
|
|
725
718
|
"data-workspace-focus-target": "",
|
|
726
719
|
language: inferWorkspaceLanguage(file.path),
|
|
727
720
|
showLineNumbers: true,
|
|
728
721
|
children: [/* @__PURE__ */ jsx(WorkspaceHeader, {
|
|
729
722
|
...headerProps,
|
|
730
723
|
copyAction: /* @__PURE__ */ jsx(CodeBlockCopyButton, {
|
|
731
|
-
size: "
|
|
724
|
+
size: "sm",
|
|
732
725
|
nativeButton: true,
|
|
733
726
|
render: /* @__PURE__ */ jsx(AppTopBar.Control, {})
|
|
734
727
|
})
|
|
@@ -737,7 +730,7 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
|
|
|
737
730
|
onScroll: handleScroll,
|
|
738
731
|
children: /* @__PURE__ */ jsx(CodeBlockContent, {})
|
|
739
732
|
})]
|
|
740
|
-
})
|
|
733
|
+
})]
|
|
741
734
|
});
|
|
742
735
|
}
|
|
743
736
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as cx } from "./class-names-
|
|
1
|
+
import { t as cx } from "./class-names-BiMDVpUo.js";
|
|
2
|
+
import { t as NavigationLink } from "./navigation-link-Cob7KBlM.js";
|
|
2
3
|
import { n as isWorkspacePathWithinRoot, t as canonicalizeAbsoluteWorkspacePath } from "./workspace-path-L_KmjRjq.js";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -93,7 +94,6 @@ function useRequiredWorkspaceNavigationRestoration() {
|
|
|
93
94
|
}
|
|
94
95
|
//#endregion
|
|
95
96
|
//#region src/components/WorkspaceLink.tsx
|
|
96
|
-
const WORKSPACE_URL_ORIGIN = "https://workspace.invalid";
|
|
97
97
|
const EXTERNAL_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
98
98
|
"http:",
|
|
99
99
|
"https:",
|
|
@@ -197,19 +197,6 @@ function resolveWorkspaceLink({ href, root, base }) {
|
|
|
197
197
|
fragment
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
function getAdapterHref(navigation, destination) {
|
|
201
|
-
try {
|
|
202
|
-
const rawHref = navigation.createHref(destination);
|
|
203
|
-
if (hasInvalidPathCharacter(rawHref)) return null;
|
|
204
|
-
const href = rawHref.trim();
|
|
205
|
-
if (!href) return null;
|
|
206
|
-
const protocol = new URL(href, WORKSPACE_URL_ORIGIN).protocol.toLowerCase();
|
|
207
|
-
if (UNSAFE_PROTOCOLS.has(protocol)) return null;
|
|
208
|
-
return href;
|
|
209
|
-
} catch {
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
200
|
function WorkspaceNavigationProvider({ children, root, base, navigation }) {
|
|
214
201
|
return /* @__PURE__ */ jsx(WorkspaceNavigationContext, {
|
|
215
202
|
value: React.useMemo(() => ({
|
|
@@ -217,8 +204,7 @@ function WorkspaceNavigationProvider({ children, root, base, navigation }) {
|
|
|
217
204
|
base,
|
|
218
205
|
navigation
|
|
219
206
|
}), [
|
|
220
|
-
base
|
|
221
|
-
base.path,
|
|
207
|
+
base,
|
|
222
208
|
navigation,
|
|
223
209
|
root
|
|
224
210
|
]),
|
|
@@ -290,28 +276,21 @@ function WorkspaceFileLink({ children, className, download, href = "", node: _no
|
|
|
290
276
|
})] }) : null]
|
|
291
277
|
});
|
|
292
278
|
}
|
|
293
|
-
const adapterHref = getAdapterHref(workspace.navigation, resolved);
|
|
294
|
-
if (!adapterHref) return /* @__PURE__ */ jsx(UnavailableWorkspaceLink, {
|
|
295
|
-
className,
|
|
296
|
-
children
|
|
297
|
-
});
|
|
298
279
|
const handleClick = (event) => {
|
|
299
280
|
onClick?.(event);
|
|
300
281
|
const actualTarget = event.currentTarget.target.toLowerCase();
|
|
301
|
-
if (event.
|
|
302
|
-
event.preventDefault();
|
|
282
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.currentTarget.hasAttribute("download") || actualTarget !== "" && actualTarget !== "_self") return;
|
|
303
283
|
const focusScope = event.currentTarget.closest("[data-workspace-restoration-scope]")?.dataset.workspaceRestorationScope;
|
|
304
284
|
restoration?.recordFocus(workspace.navigation.current.key, resolved, focusScope);
|
|
305
|
-
workspace.navigation.navigate(resolved);
|
|
306
285
|
};
|
|
307
|
-
return /* @__PURE__ */ jsx(
|
|
286
|
+
return /* @__PURE__ */ jsx(NavigationLink, {
|
|
287
|
+
render: workspace.navigation.renderLink(resolved),
|
|
308
288
|
className: cx("workspace-link workspace-link--file", className),
|
|
309
289
|
"data-streamdown": "link",
|
|
310
290
|
"data-workspace-link": "file",
|
|
311
291
|
"data-workspace-destination-fragment": resolved.fragment ?? "",
|
|
312
292
|
"data-workspace-path": resolved.path,
|
|
313
293
|
download,
|
|
314
|
-
href: adapterHref,
|
|
315
294
|
onClick: handleClick,
|
|
316
295
|
rel,
|
|
317
296
|
target,
|
|
@@ -14,14 +14,11 @@ interface WorkspaceNavigationEntry {
|
|
|
14
14
|
}
|
|
15
15
|
interface WorkspaceNavigationAdapter {
|
|
16
16
|
current: WorkspaceNavigationEntry;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
canGoForward: boolean;
|
|
23
|
-
goBack(): void;
|
|
24
|
-
goForward(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Returns an application-owned anchor or router Link for this destination.
|
|
19
|
+
* The workspace merges its semantics and event handlers into this element.
|
|
20
|
+
*/
|
|
21
|
+
renderLink(destination: WorkspaceDestination): React.ReactElement;
|
|
25
22
|
}
|
|
26
23
|
type WorkspaceLinkBase = {
|
|
27
24
|
kind: "directory";
|
|
@@ -37,7 +34,7 @@ interface WorkspaceExternalDestination {
|
|
|
37
34
|
interface WorkspaceInvalidDestination {
|
|
38
35
|
kind: "invalid";
|
|
39
36
|
href: string;
|
|
40
|
-
reason: "fragment-without-file" | "invalid-
|
|
37
|
+
reason: "fragment-without-file" | "invalid-path" | "outside-workspace" | "unsafe-protocol" | "unsupported-query";
|
|
41
38
|
}
|
|
42
39
|
type WorkspaceLinkResolution = Extract<WorkspaceDestination, {
|
|
43
40
|
kind: "file";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
//#region src/components/_internal/class-names.ts
|
|
2
2
|
function cx(...parts) {
|
|
3
|
-
if (parts.some((part) => typeof part === "function")) return (state) => parts.
|
|
3
|
+
if (parts.some((part) => typeof part === "function")) return (state) => parts.flatMap((part) => {
|
|
4
|
+
const value = typeof part === "function" ? part(state) : part;
|
|
5
|
+
return value ? [value] : [];
|
|
6
|
+
}).join(" ");
|
|
4
7
|
return parts.filter(Boolean).join(" ");
|
|
5
8
|
}
|
|
6
9
|
function mergeBaseClassName(stableClassName, className) {
|
|
@@ -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 { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -26,6 +26,7 @@ function AccordionRoot({ className, ref, ...props }) {
|
|
|
26
26
|
const classes = mergeBaseClassName(["accordion"].filter(Boolean).join(" "), className);
|
|
27
27
|
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
28
28
|
ref,
|
|
29
|
+
"data-slot": "accordion",
|
|
29
30
|
className: classes,
|
|
30
31
|
...props
|
|
31
32
|
});
|
|
@@ -37,6 +38,7 @@ function AccordionItem({ className, ref, ...props }) {
|
|
|
37
38
|
const classes = mergeBaseClassName(["accordion__item"].filter(Boolean).join(" "), className);
|
|
38
39
|
return /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
39
40
|
ref,
|
|
41
|
+
"data-slot": "accordion-item",
|
|
40
42
|
className: classes,
|
|
41
43
|
...props
|
|
42
44
|
});
|
|
@@ -45,6 +47,7 @@ function AccordionHeader({ className, ref, ...props }) {
|
|
|
45
47
|
const classes = mergeBaseClassName(["accordion__header"].filter(Boolean).join(" "), className);
|
|
46
48
|
return /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
47
49
|
ref,
|
|
50
|
+
"data-slot": "accordion-header",
|
|
48
51
|
className: classes,
|
|
49
52
|
...props
|
|
50
53
|
});
|
|
@@ -59,6 +62,7 @@ function AccordionTrigger({ className, ref, ...props }) {
|
|
|
59
62
|
const classes = mergeBaseClassName(["accordion__trigger"].filter(Boolean).join(" "), className);
|
|
60
63
|
return /* @__PURE__ */ jsx(Accordion$1.Trigger, {
|
|
61
64
|
ref,
|
|
65
|
+
"data-slot": "accordion-trigger",
|
|
62
66
|
className: classes,
|
|
63
67
|
...props
|
|
64
68
|
});
|
|
@@ -67,9 +71,10 @@ function AccordionTrigger({ className, ref, ...props }) {
|
|
|
67
71
|
* The collapsible content panel of an AccordionItem.
|
|
68
72
|
*/
|
|
69
73
|
function AccordionPanel({ className, ref, ...props }) {
|
|
70
|
-
const classes = mergeBaseClassName(
|
|
74
|
+
const classes = mergeBaseClassName("base-ui-disclosure-panel accordion__panel", className);
|
|
71
75
|
return /* @__PURE__ */ jsx(Accordion$1.Panel, {
|
|
72
76
|
ref,
|
|
77
|
+
"data-slot": "accordion-panel",
|
|
73
78
|
className: classes,
|
|
74
79
|
...props
|
|
75
80
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Collapsible } from "./Collapsible.js";
|
|
3
|
-
import {
|
|
3
|
+
import { p as ChevronRightIcon } from "../icons-DKXiSepE.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Activity.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as AgentActivityIconProps, i as AgentActivityIconKind, n as AgentActivityFaviconProps, o as AgentActivityMode, r as AgentActivityIcon, s as AgentActivitySummary, t as AgentActivityFavicon } from "../AgentActivity-
|
|
1
|
+
import { a as AgentActivityIconProps, i as AgentActivityIconKind, n as AgentActivityFaviconProps, o as AgentActivityMode, r as AgentActivityIcon, s as AgentActivitySummary, t as AgentActivityFavicon } from "../AgentActivity-D2SHSGFX.js";
|
|
2
2
|
export { AgentActivityFavicon, AgentActivityFaviconProps, AgentActivityIcon, AgentActivityIconKind, AgentActivityIconProps, AgentActivityMode, AgentActivitySummary };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as WrenchIcon, D as InfoIcon, O as LinkIcon, P as MonitorIcon, Q as WarningIcon, S as FileIcon, W as SearchIcon, X as TerminalIcon, z as PencilIcon } from "../icons-DKXiSepE.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/AgentActivity.tsx
|
|
@@ -19,9 +19,8 @@ function AgentActivityIcon({ kind }) {
|
|
|
19
19
|
/** Site favicon for URL-backed activity, with the shared icon vocabulary as fallback. */
|
|
20
20
|
function AgentActivityFavicon({ fallbackKind = "web", url }) {
|
|
21
21
|
const src = faviconHref(url);
|
|
22
|
-
const [
|
|
23
|
-
|
|
24
|
-
if (!src || failed) return /* @__PURE__ */ jsx(AgentActivityIcon, { kind: fallbackKind });
|
|
22
|
+
const [failedSrc, setFailedSrc] = React.useState(null);
|
|
23
|
+
if (!src || failedSrc === src) return /* @__PURE__ */ jsx(AgentActivityIcon, { kind: fallbackKind });
|
|
25
24
|
return /* @__PURE__ */ jsx("img", {
|
|
26
25
|
className: "activity__favicon",
|
|
27
26
|
src,
|
|
@@ -29,7 +28,7 @@ function AgentActivityFavicon({ fallbackKind = "web", url }) {
|
|
|
29
28
|
loading: "lazy",
|
|
30
29
|
decoding: "async",
|
|
31
30
|
referrerPolicy: "no-referrer",
|
|
32
|
-
onError: () =>
|
|
31
|
+
onError: () => setFailedSrc(src)
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
34
|
function faviconHref(url) {
|