@alivault/pico 0.3.2 → 0.5.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/.output/nitro.json +1 -1
- package/.output/public/assets/{index-ga3WrbUv.js → index-Di2FsKXl.js} +3 -3
- package/.output/public/assets/routes-3i6aEePK.js +2156 -0
- package/.output/public/assets/styles-CUjj8zXo.css +2 -0
- package/.output/public/screenshots/pico-mobile-alt.png +0 -0
- package/.output/public/screenshots/pico-mobile.png +0 -0
- package/.output/public/screenshots/pico-workspace-alt.png +0 -0
- package/.output/public/screenshots/pico-workspace.png +0 -0
- package/.output/server/_libs/@pierre/diffs+[...].mjs +53 -1
- package/.output/server/_libs/entities.mjs +372 -0
- package/.output/server/_libs/hast-util-from-parse5+[...].mjs +741 -0
- package/.output/server/_libs/hast-util-raw+[...].mjs +7897 -0
- package/.output/server/_libs/hast-util-sanitize.mjs +780 -0
- package/.output/server/_libs/hast-util-to-jsx-runtime+[...].mjs +3 -82
- package/.output/server/_libs/mdast-util-find-and-replace.mjs +198 -0
- package/.output/server/_libs/mdast-util-gfm+[...].mjs +4 -288
- package/.output/server/_libs/mdast-util-to-hast+[...].mjs +1 -2
- package/.output/server/_libs/react-markdown+[...].mjs +1 -1
- package/.output/server/_libs/rehype-raw.mjs +37 -0
- package/.output/server/_libs/rehype-sanitize.mjs +27 -0
- package/.output/server/_ssr/{router-DQcefit6.mjs → router-DxIs8YF4.mjs} +3 -3
- package/.output/server/_ssr/{routes-C7eO3ZVn.mjs → routes-BgLr8w7S.mjs} +286 -161
- package/.output/server/_ssr/{routes-DHXvlqAP.mjs → routes-DZ8MN7tJ.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +2 -2
- package/.output/server/{_tanstack-start-manifest_v-ChF3TvKp.mjs → _tanstack-start-manifest_v-CxIiv5yq.mjs} +4 -4
- package/.output/server/index.mjs +486 -472
- package/README.md +6 -2
- package/package.json +3 -1
- package/public/screenshots/pico-mobile-alt.png +0 -0
- package/public/screenshots/pico-mobile.png +0 -0
- package/public/screenshots/pico-workspace-alt.png +0 -0
- package/public/screenshots/pico-workspace.png +0 -0
- package/.output/public/assets/routes-BApV813x.js +0 -2151
- package/.output/public/assets/styles-4lJzavCj.css +0 -2
- package/.output/server/_libs/mdast-util-find-and-replace+[...].mjs +0 -636
|
@@ -2,7 +2,7 @@ import { i as __toESM } from "../_runtime.mjs";
|
|
|
2
2
|
import { A as DialogRoot, C as MenuPortal, D as TabsTab, E as TabsList$1, F as DialogBackdrop, I as Separator, K as mergeProps, L as Input, M as DialogPopup, N as DialogDescription$1, O as TabsRoot, P as DialogClose, R as Button, S as MenuPositioner, T as MenuItem, X as require_react, Y as require_jsx_runtime, _ as AccordionRoot, a as CollapsiblePanel, b as MenuSubmenuRoot, c as PopoverPopup, d as PopoverTrigger$1, f as PopoverRoot, g as AccordionItem$1, h as AccordionHeader, i as ContextMenuRoot, j as DialogPortal$1, k as DialogTitle$1, l as PopoverPositioner, m as AccordionTrigger$1, n as Toggle, o as CollapsibleTrigger$1, p as AccordionPanel, r as ContextMenuTrigger$1, s as CollapsibleRoot, t as ToggleGroup, u as PopoverPortal, v as MenuSubmenuTrigger, w as MenuPopup, x as MenuRoot, y as MenuTrigger, z as useRender } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
3
|
import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
|
|
4
4
|
import { A as ChevronsUpDown, B as ArrowDown, C as FolderPlus, D as Copy, E as Download, F as Check, I as ArrowUp, L as ArrowUpToLine, M as ChevronUp, N as ChevronRight, O as Command, P as ChevronDown, S as Folder, T as EllipsisVertical, _ as ListEnd, a as Square, b as GitBranch, c as Settings2, d as PanelLeft, f as PanelLeftOpen, g as ListStart, h as OctagonX, j as ChevronsDownUp, l as Search, n as WandSparkles, o as SquarePen, p as PanelLeftClose, r as Upload, s as SquareArrowOutUpRight, t as X, u as PanelRight, w as Ellipsis, x as GitCommitHorizontal, y as ImagePlus, z as ArrowLeft } from "../_libs/lucide-react.mjs";
|
|
5
|
-
import { $ as readStoredRightSidebarOpen, B as normalizeSessionSelectionKeys, C as TooltipContent, E as VIEWER_CONTEXT_STORAGE_KEY, G as readStoredAutoScrollEnabled, H as normalizeThemeMode, I as flattenTree, J as readStoredDraftDirectory, K as readStoredCenterMessages, L as getSessionTitle, M as createInitialSessionState, O as buildItemsFromSync, Q as readStoredRecentDirectories, S as Tooltip$1, T as TooltipTrigger, U as previewUrlForImage, V as normalizeStoredDirectoryList, W as promptDraftKey, X as readStoredPinnedSessionKeys, Y as readStoredHideToolBlocks, Z as readStoredPromptDraft, _ as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, a as HIDE_TOOL_BLOCKS_STORAGE_KEY, at as safeLocalStorageSetItem, c as PINNED_SESSIONS_STORAGE_KEY, ct as thinkingSummaryText, d as RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY, et as readStoredSessionDoneDesktopNotificationsEnabled, f as RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY, g as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, h as Route, i as DRAFT_DIRECTORY_STORAGE_KEY, it as safeLocalStorageGetItem, j as createContextId, k as cn, l as RECENT_DIRECTORIES_STORAGE_KEY, m as RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY, n as CENTER_MESSAGES_STORAGE_KEY, nt as readStoredSidebarDirectories, o as Kbd, ot as sameContextUsage, p as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, q as readStoredCollapsedDirectories, r as COLLAPSED_DIRECTORIES_STORAGE_KEY, rt as rememberStoredPromptDraft, s as KeyboardShortcutContent, st as sessionListEntryKey, t as AUTO_SCROLL_ENABLED_STORAGE_KEY, tt as readStoredSessionDoneSoundEnabled, u as RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY, v as SIDEBAR_DIRECTORIES_STORAGE_KEY, x as TitleTooltip, y as Spinner, z as normalizePromptImage } from "./routes-
|
|
5
|
+
import { $ as readStoredRightSidebarOpen, B as normalizeSessionSelectionKeys, C as TooltipContent, E as VIEWER_CONTEXT_STORAGE_KEY, G as readStoredAutoScrollEnabled, H as normalizeThemeMode, I as flattenTree, J as readStoredDraftDirectory, K as readStoredCenterMessages, L as getSessionTitle, M as createInitialSessionState, O as buildItemsFromSync, Q as readStoredRecentDirectories, S as Tooltip$1, T as TooltipTrigger, U as previewUrlForImage, V as normalizeStoredDirectoryList, W as promptDraftKey, X as readStoredPinnedSessionKeys, Y as readStoredHideToolBlocks, Z as readStoredPromptDraft, _ as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, a as HIDE_TOOL_BLOCKS_STORAGE_KEY, at as safeLocalStorageSetItem, c as PINNED_SESSIONS_STORAGE_KEY, ct as thinkingSummaryText, d as RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY, et as readStoredSessionDoneDesktopNotificationsEnabled, f as RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY, g as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, h as Route, i as DRAFT_DIRECTORY_STORAGE_KEY, it as safeLocalStorageGetItem, j as createContextId, k as cn, l as RECENT_DIRECTORIES_STORAGE_KEY, m as RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY, n as CENTER_MESSAGES_STORAGE_KEY, nt as readStoredSidebarDirectories, o as Kbd, ot as sameContextUsage, p as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, q as readStoredCollapsedDirectories, r as COLLAPSED_DIRECTORIES_STORAGE_KEY, rt as rememberStoredPromptDraft, s as KeyboardShortcutContent, st as sessionListEntryKey, t as AUTO_SCROLL_ENABLED_STORAGE_KEY, tt as readStoredSessionDoneSoundEnabled, u as RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY, v as SIDEBAR_DIRECTORIES_STORAGE_KEY, x as TitleTooltip, y as Spinner, z as normalizePromptImage } from "./routes-DZ8MN7tJ.mjs";
|
|
6
6
|
import { i as useQuery, n as useIsMutating, o as useQueryClient, r as useIsFetching, t as useMutation } from "../_libs/tanstack__react-query.mjs";
|
|
7
7
|
import { t as useHotkeys } from "../_libs/tanstack__react-hotkeys.mjs";
|
|
8
8
|
import { a as matchesKeyboardEvent, i as batch, o as formatForDisplay, r as createStore } from "../_libs/@tanstack/hotkeys+[...].mjs";
|
|
@@ -15,11 +15,14 @@ import { t as _e } from "../_libs/cmdk.mjs";
|
|
|
15
15
|
import { t as Drawer } from "../_libs/vaul.mjs";
|
|
16
16
|
import { n as MultiFileDiff, t as PatchDiff } from "../_libs/@pierre/diffs+[...].mjs";
|
|
17
17
|
import { t as Markdown } from "../_libs/react-markdown+[...].mjs";
|
|
18
|
+
import { t as rehypeRaw } from "../_libs/rehype-raw.mjs";
|
|
19
|
+
import { n as defaultSchema } from "../_libs/hast-util-sanitize.mjs";
|
|
20
|
+
import { t as rehypeSanitize } from "../_libs/rehype-sanitize.mjs";
|
|
18
21
|
import { t as remarkGfm } from "../_libs/remark-gfm.mjs";
|
|
19
22
|
import { a as getBuiltInSpriteSheet, i as getBuiltInFileIconColor, n as FileTree, r as createFileTreeIconResolver, t as useFileTree } from "../_libs/@pierre/trees+[...].mjs";
|
|
20
23
|
import { a as closestCenter, d as useSensors, f as CSS$1, i as PointerSensor, n as DragOverlay, t as DndContext, u as useSensor } from "../_libs/@dnd-kit/core+[...].mjs";
|
|
21
24
|
import { a as verticalListSortingStrategy, i as useSortable, n as arrayMove, r as horizontalListSortingStrategy, t as SortableContext } from "../_libs/dnd-kit__sortable.mjs";
|
|
22
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/routes-
|
|
25
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/routes-BgLr8w7S.js
|
|
23
26
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
24
27
|
var import_jsx_runtime = require_jsx_runtime();
|
|
25
28
|
var MOBILE_BREAKPOINT = 768;
|
|
@@ -8547,26 +8550,9 @@ function applyCompletionItem({ value, query, item }) {
|
|
|
8547
8550
|
selectionEnd: selection
|
|
8548
8551
|
};
|
|
8549
8552
|
}
|
|
8550
|
-
function Collapsible$1({ ...props }) {
|
|
8551
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleRoot, {
|
|
8552
|
-
"data-slot": "collapsible",
|
|
8553
|
-
...props
|
|
8554
|
-
});
|
|
8555
|
-
}
|
|
8556
|
-
function CollapsibleTrigger({ ...props }) {
|
|
8557
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTrigger$1, {
|
|
8558
|
-
"data-slot": "collapsible-trigger",
|
|
8559
|
-
...props
|
|
8560
|
-
});
|
|
8561
|
-
}
|
|
8562
|
-
function CollapsibleContent({ ...props }) {
|
|
8563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsiblePanel, {
|
|
8564
|
-
"data-slot": "collapsible-content",
|
|
8565
|
-
...props
|
|
8566
|
-
});
|
|
8567
|
-
}
|
|
8568
8553
|
var highlightCache = /* @__PURE__ */ new Map();
|
|
8569
8554
|
var MemoizedReactMarkdown = import_react.memo(Markdown);
|
|
8555
|
+
var MARKDOWN_REHYPE_PLUGINS = [rehypeRaw, [rehypeSanitize, defaultSchema]];
|
|
8570
8556
|
var MARKDOWN_REMARK_PLUGINS = [remarkGfm];
|
|
8571
8557
|
var MarkdownRenderingContext = import_react.createContext({ streaming: false });
|
|
8572
8558
|
function MarkdownAnchor({ children, href, node: _node, ...props }) {
|
|
@@ -8850,6 +8836,7 @@ var MarkdownBlock = import_react.memo(function MarkdownBlock({ streaming = false
|
|
|
8850
8836
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8851
8837
|
className: "prose prose-sm max-w-none wrap-break-word dark:prose-invert prose-headings:font-semibold prose-p:my-2 prose-pre:m-0 prose-ol:my-2 prose-ul:my-2",
|
|
8852
8838
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemoizedReactMarkdown, {
|
|
8839
|
+
rehypePlugins: MARKDOWN_REHYPE_PLUGINS,
|
|
8853
8840
|
remarkPlugins: MARKDOWN_REMARK_PLUGINS,
|
|
8854
8841
|
components: MARKDOWN_COMPONENTS,
|
|
8855
8842
|
children: text
|
|
@@ -8857,6 +8844,24 @@ var MarkdownBlock = import_react.memo(function MarkdownBlock({ streaming = false
|
|
|
8857
8844
|
})
|
|
8858
8845
|
});
|
|
8859
8846
|
});
|
|
8847
|
+
function Collapsible$1({ ...props }) {
|
|
8848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleRoot, {
|
|
8849
|
+
"data-slot": "collapsible",
|
|
8850
|
+
...props
|
|
8851
|
+
});
|
|
8852
|
+
}
|
|
8853
|
+
function CollapsibleTrigger({ ...props }) {
|
|
8854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTrigger$1, {
|
|
8855
|
+
"data-slot": "collapsible-trigger",
|
|
8856
|
+
...props
|
|
8857
|
+
});
|
|
8858
|
+
}
|
|
8859
|
+
function CollapsibleContent({ ...props }) {
|
|
8860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsiblePanel, {
|
|
8861
|
+
"data-slot": "collapsible-content",
|
|
8862
|
+
...props
|
|
8863
|
+
});
|
|
8864
|
+
}
|
|
8860
8865
|
function promptImageKey(image) {
|
|
8861
8866
|
return `${image.previewUrl}:${image.data.slice(0, 24)}`;
|
|
8862
8867
|
}
|
|
@@ -10111,7 +10116,7 @@ function ToolBlockCardContent({ blockKey, header, store }) {
|
|
|
10111
10116
|
className: "truncate font-medium whitespace-nowrap text-foreground",
|
|
10112
10117
|
children: toolDisplayName(header.name)
|
|
10113
10118
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
10114
|
-
className: "truncate text-muted-foreground",
|
|
10119
|
+
className: cn("truncate text-muted-foreground", header.name === "write" && "tabular-nums"),
|
|
10115
10120
|
children: header.summary
|
|
10116
10121
|
})]
|
|
10117
10122
|
}),
|
|
@@ -13104,12 +13109,73 @@ function ContextMenuSeparator({ className, ...props }) {
|
|
|
13104
13109
|
...props
|
|
13105
13110
|
});
|
|
13106
13111
|
}
|
|
13112
|
+
var toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
13113
|
+
variants: {
|
|
13114
|
+
variant: {
|
|
13115
|
+
default: "bg-transparent",
|
|
13116
|
+
outline: "border border-input bg-transparent hover:bg-muted"
|
|
13117
|
+
},
|
|
13118
|
+
size: {
|
|
13119
|
+
default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
13120
|
+
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
13121
|
+
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"
|
|
13122
|
+
}
|
|
13123
|
+
},
|
|
13124
|
+
defaultVariants: {
|
|
13125
|
+
variant: "default",
|
|
13126
|
+
size: "default"
|
|
13127
|
+
}
|
|
13128
|
+
});
|
|
13129
|
+
var ToggleGroupContext = import_react.createContext({
|
|
13130
|
+
size: "default",
|
|
13131
|
+
variant: "default",
|
|
13132
|
+
spacing: 0,
|
|
13133
|
+
orientation: "horizontal"
|
|
13134
|
+
});
|
|
13135
|
+
function ToggleGroup$1({ className, variant, size, spacing = 0, orientation = "horizontal", children, ...props }) {
|
|
13136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, {
|
|
13137
|
+
"data-slot": "toggle-group",
|
|
13138
|
+
"data-variant": variant,
|
|
13139
|
+
"data-size": size,
|
|
13140
|
+
"data-spacing": spacing,
|
|
13141
|
+
"data-orientation": orientation,
|
|
13142
|
+
style: { "--gap": spacing },
|
|
13143
|
+
className: cn("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch", className),
|
|
13144
|
+
...props,
|
|
13145
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupContext.Provider, {
|
|
13146
|
+
value: {
|
|
13147
|
+
variant,
|
|
13148
|
+
size,
|
|
13149
|
+
spacing,
|
|
13150
|
+
orientation
|
|
13151
|
+
},
|
|
13152
|
+
children
|
|
13153
|
+
})
|
|
13154
|
+
});
|
|
13155
|
+
}
|
|
13156
|
+
function ToggleGroupItem({ className, children, variant = "default", size = "default", ...props }) {
|
|
13157
|
+
const context = import_react.useContext(ToggleGroupContext);
|
|
13158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Toggle, {
|
|
13159
|
+
"data-slot": "toggle-group-item",
|
|
13160
|
+
"data-variant": context.variant || variant,
|
|
13161
|
+
"data-size": context.size || size,
|
|
13162
|
+
"data-spacing": context.spacing,
|
|
13163
|
+
className: cn("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", toggleVariants({
|
|
13164
|
+
variant: context.variant || variant,
|
|
13165
|
+
size: context.size || size
|
|
13166
|
+
}), className),
|
|
13167
|
+
...props,
|
|
13168
|
+
children
|
|
13169
|
+
});
|
|
13170
|
+
}
|
|
13107
13171
|
function GitSectionNote({ children, tone = "muted", className }) {
|
|
13108
13172
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13109
13173
|
className: cn("flex min-h-8 items-center gap-2 text-sm leading-6", tone === "destructive" ? "text-destructive" : "text-muted-foreground", className),
|
|
13110
13174
|
children
|
|
13111
13175
|
});
|
|
13112
13176
|
}
|
|
13177
|
+
var EMPTY_PROJECT_FILE_PATHS = [];
|
|
13178
|
+
var EMPTY_GIT_CHANGE_FILES = [];
|
|
13113
13179
|
var PROJECT_FILE_QUERY_STALE_TIME_MS = 1e3 * 30;
|
|
13114
13180
|
var PROJECT_FILE_QUERY_GC_TIME_MS = 1e3 * 60 * 10;
|
|
13115
13181
|
var PROJECT_FILE_TREE_DEFAULT_WIDTH = 320;
|
|
@@ -13135,6 +13201,8 @@ var CODE_LANGUAGE_BY_EXTENSION = {
|
|
|
13135
13201
|
js: "javascript",
|
|
13136
13202
|
jsx: "jsx",
|
|
13137
13203
|
json: "json",
|
|
13204
|
+
markdown: "markdown",
|
|
13205
|
+
md: "markdown",
|
|
13138
13206
|
jsonc: "jsonc",
|
|
13139
13207
|
mjs: "javascript",
|
|
13140
13208
|
mdx: "mdx",
|
|
@@ -13146,11 +13214,18 @@ var CODE_LANGUAGE_BY_EXTENSION = {
|
|
|
13146
13214
|
yaml: "yaml",
|
|
13147
13215
|
yml: "yaml"
|
|
13148
13216
|
};
|
|
13217
|
+
function fileExtensionFromPath(path) {
|
|
13218
|
+
return (path.split(/[?#]/)[0] || "").match(/\.([A-Za-z0-9]+)$/)?.[1]?.toLowerCase();
|
|
13219
|
+
}
|
|
13149
13220
|
function codeLanguageFromPath(path) {
|
|
13150
|
-
const extension = (path
|
|
13221
|
+
const extension = fileExtensionFromPath(path);
|
|
13151
13222
|
if (!extension) return void 0;
|
|
13152
13223
|
return CODE_LANGUAGE_BY_EXTENSION[extension];
|
|
13153
13224
|
}
|
|
13225
|
+
function isMarkdownFilePath(path) {
|
|
13226
|
+
const extension = fileExtensionFromPath(path);
|
|
13227
|
+
return extension === "md" || extension === "markdown";
|
|
13228
|
+
}
|
|
13154
13229
|
function hasHighlightHtml(payload) {
|
|
13155
13230
|
return Boolean(payload && "html" in payload && payload.html);
|
|
13156
13231
|
}
|
|
@@ -13196,11 +13271,15 @@ var GIT_FILE_TREE_UNSAFE_CSS = `
|
|
|
13196
13271
|
--trees-bg-override: var(--background);
|
|
13197
13272
|
--trees-fg-override: var(--foreground);
|
|
13198
13273
|
--trees-border-color-override: var(--border);
|
|
13199
|
-
--trees-muted-
|
|
13274
|
+
--trees-fg-muted-override: var(--muted-foreground);
|
|
13200
13275
|
--trees-selected-bg-override: var(--accent);
|
|
13201
13276
|
--trees-selected-fg-override: var(--accent-foreground);
|
|
13202
13277
|
--trees-padding-inline-override: 0px;
|
|
13203
13278
|
}
|
|
13279
|
+
|
|
13280
|
+
[data-file-tree-virtualized-scroll='true'] {
|
|
13281
|
+
padding-inline: 0 16px;
|
|
13282
|
+
}
|
|
13204
13283
|
`;
|
|
13205
13284
|
var PROJECT_FILE_ICON_SPRITE_SHEET = getBuiltInSpriteSheet("complete");
|
|
13206
13285
|
var projectFileIconResolver = createFileTreeIconResolver({
|
|
@@ -13233,6 +13312,36 @@ function ProjectFileTypeIcon({ path }) {
|
|
|
13233
13312
|
function isFileTreeDirectoryHandle(item) {
|
|
13234
13313
|
return item?.isDirectory() === true;
|
|
13235
13314
|
}
|
|
13315
|
+
function getProjectFileTreeGitStatusFromPorcelain(status) {
|
|
13316
|
+
const indexStatus = status[0] || " ";
|
|
13317
|
+
const worktreeStatus = status[1] || " ";
|
|
13318
|
+
if (status === "??") return "untracked";
|
|
13319
|
+
if (status === "!!") return "ignored";
|
|
13320
|
+
if (indexStatus === "R" || worktreeStatus === "R") return "renamed";
|
|
13321
|
+
if (indexStatus === "C" || worktreeStatus === "C") return "renamed";
|
|
13322
|
+
if (indexStatus === "D" || worktreeStatus === "D") return "deleted";
|
|
13323
|
+
if (indexStatus === "A" || worktreeStatus === "A") return "added";
|
|
13324
|
+
return "modified";
|
|
13325
|
+
}
|
|
13326
|
+
function getProjectFileTreeGitStatus(files) {
|
|
13327
|
+
return files.map((file) => ({
|
|
13328
|
+
path: file.path,
|
|
13329
|
+
status: getProjectFileTreeGitStatusFromPorcelain(file.status)
|
|
13330
|
+
}));
|
|
13331
|
+
}
|
|
13332
|
+
function getProjectFileTreePaths(paths, files) {
|
|
13333
|
+
if (files.length === 0) return paths;
|
|
13334
|
+
const pathSet = new Set(paths);
|
|
13335
|
+
let addedPath = false;
|
|
13336
|
+
for (const file of files) {
|
|
13337
|
+
if (getProjectFileTreeGitStatusFromPorcelain(file.status) !== "deleted") continue;
|
|
13338
|
+
if (!file.path || pathSet.has(file.path)) continue;
|
|
13339
|
+
pathSet.add(file.path);
|
|
13340
|
+
addedPath = true;
|
|
13341
|
+
}
|
|
13342
|
+
if (!addedPath) return paths;
|
|
13343
|
+
return [...pathSet];
|
|
13344
|
+
}
|
|
13236
13345
|
function getProjectFileDirectoryPaths(paths) {
|
|
13237
13346
|
const directoryPaths = /* @__PURE__ */ new Set();
|
|
13238
13347
|
for (const path of paths) {
|
|
@@ -13241,7 +13350,7 @@ function getProjectFileDirectoryPaths(paths) {
|
|
|
13241
13350
|
}
|
|
13242
13351
|
return [...directoryPaths].sort((left, right) => right.split("/").length - left.split("/").length || right.length - left.length || right.localeCompare(left));
|
|
13243
13352
|
}
|
|
13244
|
-
function ProjectFileTree({ collapseAllRevision, paths, selectedPath, onSelectFile }) {
|
|
13353
|
+
function ProjectFileTree({ collapseAllRevision, gitStatus, paths, selectedPath, onSelectFile }) {
|
|
13245
13354
|
const validPathsRef = import_react.useRef(new Set(paths));
|
|
13246
13355
|
const onSelectFileRef = import_react.useRef(onSelectFile);
|
|
13247
13356
|
const lastCollapseAllRevisionRef = import_react.useRef(0);
|
|
@@ -13250,6 +13359,7 @@ function ProjectFileTree({ collapseAllRevision, paths, selectedPath, onSelectFil
|
|
|
13250
13359
|
const { model } = useFileTree({
|
|
13251
13360
|
paths,
|
|
13252
13361
|
flattenEmptyDirectories: true,
|
|
13362
|
+
gitStatus,
|
|
13253
13363
|
initialExpansion: 1,
|
|
13254
13364
|
initialSelectedPaths: selectedPath ? [selectedPath] : [],
|
|
13255
13365
|
onSelectionChange: (selectedPaths) => {
|
|
@@ -13263,6 +13373,9 @@ function ProjectFileTree({ collapseAllRevision, paths, selectedPath, onSelectFil
|
|
|
13263
13373
|
import_react.useEffect(() => {
|
|
13264
13374
|
model.resetPaths(paths);
|
|
13265
13375
|
}, [model, paths]);
|
|
13376
|
+
import_react.useEffect(() => {
|
|
13377
|
+
model.setGitStatus(gitStatus);
|
|
13378
|
+
}, [gitStatus, model]);
|
|
13266
13379
|
import_react.useEffect(() => {
|
|
13267
13380
|
if (!selectedPath) return;
|
|
13268
13381
|
const item = model.getItem(selectedPath);
|
|
@@ -13310,7 +13423,8 @@ function ProjectFilesWorkspace({ viewerContextId, cwd, active, activeFilePath, o
|
|
|
13310
13423
|
const normalizedCwd = normalizeCwd(cwd);
|
|
13311
13424
|
const [openFileDialogOpen, setOpenFileDialogOpen] = import_react.useState(false);
|
|
13312
13425
|
const [collapseAllRevision, setCollapseAllRevision] = import_react.useState(0);
|
|
13313
|
-
const
|
|
13426
|
+
const inlinePreview = previewMode === "inline";
|
|
13427
|
+
const showInlinePreview = inlinePreview && Boolean(activeFilePath);
|
|
13314
13428
|
const fileTreeQuery = useQuery({
|
|
13315
13429
|
...projectFileTreeQueryOptions({
|
|
13316
13430
|
viewerContextId,
|
|
@@ -13324,12 +13438,25 @@ function ProjectFilesWorkspace({ viewerContextId, cwd, active, activeFilePath, o
|
|
|
13324
13438
|
"error"
|
|
13325
13439
|
]
|
|
13326
13440
|
});
|
|
13327
|
-
const
|
|
13441
|
+
const gitFilesQuery = useQuery({
|
|
13442
|
+
...gitChangesQueryOptions({
|
|
13443
|
+
viewerContextId,
|
|
13444
|
+
cwd: normalizedCwd,
|
|
13445
|
+
scope: "files"
|
|
13446
|
+
}),
|
|
13447
|
+
enabled: Boolean(active && viewerContextId && normalizedCwd),
|
|
13448
|
+
select: (data) => data.files ?? [],
|
|
13449
|
+
notifyOnChangeProps: ["data"]
|
|
13450
|
+
});
|
|
13451
|
+
const projectPaths = fileTreeQuery.data ?? EMPTY_PROJECT_FILE_PATHS;
|
|
13452
|
+
const gitFiles = gitFilesQuery.data ?? EMPTY_GIT_CHANGE_FILES;
|
|
13453
|
+
const paths = import_react.useMemo(() => getProjectFileTreePaths(projectPaths, gitFiles), [gitFiles, projectPaths]);
|
|
13454
|
+
const gitStatus = import_react.useMemo(() => getProjectFileTreeGitStatus(gitFiles), [gitFiles]);
|
|
13328
13455
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
13329
|
-
className: cn("h-full min-h-0 overflow-hidden",
|
|
13456
|
+
className: cn("h-full min-h-0 overflow-hidden", inlinePreview ? "relative flex flex-col" : "flex flex-col"),
|
|
13330
13457
|
children: [
|
|
13331
13458
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
13332
|
-
className:
|
|
13459
|
+
className: "flex min-h-0 flex-1 flex-col overflow-hidden bg-background",
|
|
13333
13460
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
13334
13461
|
className: "flex shrink-0 items-center justify-between gap-2 border-b border-border/70 p-2",
|
|
13335
13462
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -13366,36 +13493,36 @@ function ProjectFilesWorkspace({ viewerContextId, cwd, active, activeFilePath, o
|
|
|
13366
13493
|
children: getErrorMessage(fileTreeQuery.error, "Failed to load files")
|
|
13367
13494
|
}) : paths.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectFileTree, {
|
|
13368
13495
|
collapseAllRevision,
|
|
13496
|
+
gitStatus,
|
|
13369
13497
|
paths,
|
|
13370
13498
|
selectedPath: activeFilePath,
|
|
13371
13499
|
onSelectFile: onOpenFile
|
|
13372
13500
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GitSectionNote, { children: "No files found." })
|
|
13373
13501
|
})]
|
|
13374
13502
|
}),
|
|
13375
|
-
|
|
13376
|
-
|
|
13503
|
+
inlinePreview ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
13504
|
+
"aria-hidden": !showInlinePreview,
|
|
13505
|
+
inert: !showInlinePreview,
|
|
13506
|
+
className: cn("absolute inset-0 z-20 flex min-h-0 flex-col overflow-hidden bg-background transition-transform duration-200 ease-out", showInlinePreview ? "translate-x-0 shadow-xl" : "pointer-events-none translate-x-full"),
|
|
13377
13507
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
13378
|
-
className: "flex h-10 shrink-0 items-center
|
|
13379
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.
|
|
13380
|
-
|
|
13508
|
+
className: "flex h-10 shrink-0 items-center gap-2 border-b border-border/70 px-2 text-xs font-medium text-muted-foreground",
|
|
13509
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
13510
|
+
type: "button",
|
|
13511
|
+
"aria-label": "Back to file tree",
|
|
13512
|
+
className: "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md px-2 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
13513
|
+
onClick: onCloseFile,
|
|
13514
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowLeft, { className: "size-4" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Files" })]
|
|
13515
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
13516
|
+
className: "min-w-0 flex-1 truncate",
|
|
13381
13517
|
title: activeFilePath,
|
|
13382
13518
|
children: activeFilePath
|
|
13383
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
|
|
13384
|
-
title: "Close file preview",
|
|
13385
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
13386
|
-
type: "button",
|
|
13387
|
-
"aria-label": "Close file preview",
|
|
13388
|
-
className: "inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
13389
|
-
onClick: onCloseFile,
|
|
13390
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { className: "size-4" })
|
|
13391
|
-
})
|
|
13392
13519
|
})]
|
|
13393
13520
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13394
13521
|
className: "min-h-0 flex-1 overflow-hidden",
|
|
13395
13522
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectFileContent, {
|
|
13396
13523
|
viewerContextId,
|
|
13397
13524
|
cwd: normalizedCwd,
|
|
13398
|
-
active,
|
|
13525
|
+
active: active && showInlinePreview,
|
|
13399
13526
|
path: activeFilePath
|
|
13400
13527
|
})
|
|
13401
13528
|
})]
|
|
@@ -13411,24 +13538,26 @@ function ProjectFilesWorkspace({ viewerContextId, cwd, active, activeFilePath, o
|
|
|
13411
13538
|
}
|
|
13412
13539
|
function ProjectOpenFileDialog({ open, onOpenChange, paths, onOpenFile }) {
|
|
13413
13540
|
const [query, setQuery] = import_react.useState("");
|
|
13541
|
+
const isMobile = useIsMobile();
|
|
13542
|
+
const shouldAutoFocus = useCommandSurfaceAutoFocus(isMobile);
|
|
13414
13543
|
import_react.useEffect(() => {
|
|
13415
13544
|
if (!open) setQuery("");
|
|
13416
13545
|
}, [open]);
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
|
|
13546
|
+
const commandBody = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Command$1, {
|
|
13547
|
+
shouldFilter: true,
|
|
13548
|
+
className: cn(isMobile && "min-h-0 flex-1"),
|
|
13549
|
+
children: [
|
|
13550
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProjectFileIconSprite, {}),
|
|
13551
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandInput, {
|
|
13552
|
+
autoFocus: shouldAutoFocus,
|
|
13553
|
+
value: query,
|
|
13554
|
+
onValueChange: setQuery,
|
|
13555
|
+
placeholder: "Search files…",
|
|
13556
|
+
className: "text-base md:text-sm"
|
|
13557
|
+
}),
|
|
13558
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CommandList, {
|
|
13559
|
+
className: cn(isMobile && "max-h-none min-h-0 flex-1"),
|
|
13560
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandEmpty, { children: "No files found." }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandGroup, {
|
|
13432
13561
|
heading: "Files",
|
|
13433
13562
|
children: paths.map((path) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CommandItem, {
|
|
13434
13563
|
value: path,
|
|
@@ -13442,10 +13571,29 @@ function ProjectOpenFileDialog({ open, onOpenChange, paths, onOpenFile }) {
|
|
|
13442
13571
|
children: path
|
|
13443
13572
|
})]
|
|
13444
13573
|
}, path))
|
|
13445
|
-
})]
|
|
13446
|
-
|
|
13574
|
+
})]
|
|
13575
|
+
})
|
|
13576
|
+
]
|
|
13577
|
+
});
|
|
13578
|
+
if (isMobile) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Drawer$1, {
|
|
13579
|
+
open,
|
|
13580
|
+
onOpenChange,
|
|
13581
|
+
autoFocus: shouldAutoFocus,
|
|
13582
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerContent, {
|
|
13583
|
+
className: "max-h-[90svh] overflow-hidden",
|
|
13584
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerHeader, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerTitle, { children: "Open Files" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerDescription, { children: "Search project files to open." })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13585
|
+
className: "flex min-h-0 flex-1 flex-col overflow-hidden px-4 pb-4",
|
|
13586
|
+
children: commandBody
|
|
13587
|
+
})]
|
|
13447
13588
|
})
|
|
13448
13589
|
});
|
|
13590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandDialog, {
|
|
13591
|
+
open,
|
|
13592
|
+
onOpenChange,
|
|
13593
|
+
title: "Open Files",
|
|
13594
|
+
description: "Search project files to open.",
|
|
13595
|
+
children: commandBody
|
|
13596
|
+
});
|
|
13449
13597
|
}
|
|
13450
13598
|
function ProjectFileContent({ viewerContextId, cwd, active, path }) {
|
|
13451
13599
|
const normalizedCwd = normalizeCwd(cwd);
|
|
@@ -13464,10 +13612,14 @@ function ProjectFileContent({ viewerContextId, cwd, active, path }) {
|
|
|
13464
13612
|
});
|
|
13465
13613
|
const content = fileQuery.data?.content ?? "";
|
|
13466
13614
|
const language = codeLanguageFromPath(path);
|
|
13615
|
+
const isMarkdownFile = isMarkdownFilePath(path);
|
|
13616
|
+
const [markdownViewModes, setMarkdownViewModes] = import_react.useState({});
|
|
13617
|
+
const markdownViewMode = isMarkdownFile ? markdownViewModes[path] || "preview" : "source";
|
|
13618
|
+
const showMarkdownPreview = isMarkdownFile && markdownViewMode === "preview";
|
|
13467
13619
|
const [highlighted, setHighlighted] = import_react.useState(null);
|
|
13468
13620
|
import_react.useEffect(() => {
|
|
13469
13621
|
let cancelled = false;
|
|
13470
|
-
if (!active || !content || !language) {
|
|
13622
|
+
if (!active || !content || !language || showMarkdownPreview) {
|
|
13471
13623
|
setHighlighted(null);
|
|
13472
13624
|
return;
|
|
13473
13625
|
}
|
|
@@ -13486,33 +13638,63 @@ function ProjectFileContent({ viewerContextId, cwd, active, path }) {
|
|
|
13486
13638
|
}, [
|
|
13487
13639
|
active,
|
|
13488
13640
|
content,
|
|
13489
|
-
language
|
|
13641
|
+
language,
|
|
13642
|
+
showMarkdownPreview
|
|
13490
13643
|
]);
|
|
13491
13644
|
if (!path) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13492
13645
|
className: "flex h-full items-center justify-center p-6 text-center text-sm text-muted-foreground",
|
|
13493
13646
|
children: "Select a file to preview it."
|
|
13494
13647
|
});
|
|
13495
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
13496
|
-
className: "h-full min-h-0
|
|
13497
|
-
children:
|
|
13498
|
-
className: "
|
|
13499
|
-
children:
|
|
13500
|
-
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
|
|
13648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
13649
|
+
className: "flex h-full min-h-0 flex-col bg-background",
|
|
13650
|
+
children: [isMarkdownFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
13651
|
+
className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/70 px-3 py-2",
|
|
13652
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13653
|
+
className: "truncate text-xs font-medium text-muted-foreground",
|
|
13654
|
+
children: "Markdown"
|
|
13655
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ToggleGroup$1, {
|
|
13656
|
+
variant: "outline",
|
|
13657
|
+
value: [markdownViewMode],
|
|
13658
|
+
onValueChange: (values) => {
|
|
13659
|
+
const value = values[0];
|
|
13660
|
+
if (value === "preview" || value === "source") setMarkdownViewModes((current) => ({
|
|
13661
|
+
...current,
|
|
13662
|
+
[path]: value
|
|
13663
|
+
}));
|
|
13664
|
+
},
|
|
13665
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupItem, {
|
|
13666
|
+
value: "preview",
|
|
13667
|
+
children: "Preview"
|
|
13668
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupItem, {
|
|
13669
|
+
value: "source",
|
|
13670
|
+
children: "Source"
|
|
13671
|
+
})]
|
|
13672
|
+
})]
|
|
13673
|
+
}) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13674
|
+
className: "min-h-0 flex-1 overflow-auto",
|
|
13675
|
+
children: fileQuery.isPending && !fileQuery.data ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13676
|
+
className: "p-4",
|
|
13677
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(GitSectionNote, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {}), " Loading file…"] })
|
|
13678
|
+
}) : fileQuery.error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13679
|
+
className: "p-4",
|
|
13680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GitSectionNote, {
|
|
13681
|
+
tone: "destructive",
|
|
13682
|
+
children: getErrorMessage(fileQuery.error, "Failed to load file")
|
|
13683
|
+
})
|
|
13684
|
+
}) : showMarkdownPreview ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
13685
|
+
className: "min-h-full p-4 text-foreground",
|
|
13686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MarkdownBlock, { text: content })
|
|
13687
|
+
}) : hasHighlightHtml(highlighted) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
|
|
13688
|
+
className: "m-0 min-h-full p-4 font-mono text-[13px] leading-5 whitespace-pre-wrap text-foreground",
|
|
13689
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
13690
|
+
className: cn(language && `language-${language}`),
|
|
13691
|
+
dangerouslySetInnerHTML: { __html: highlighted.html }
|
|
13692
|
+
})
|
|
13693
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
|
|
13694
|
+
className: "m-0 min-h-full p-4 font-mono text-[13px] leading-5 whitespace-pre-wrap text-foreground",
|
|
13695
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: content })
|
|
13511
13696
|
})
|
|
13512
|
-
})
|
|
13513
|
-
className: "m-0 min-h-full p-4 font-mono text-[13px] leading-5 whitespace-pre-wrap text-foreground",
|
|
13514
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: content })
|
|
13515
|
-
})
|
|
13697
|
+
})]
|
|
13516
13698
|
});
|
|
13517
13699
|
}
|
|
13518
13700
|
function FileViewerTabContent({ active, dragging = false, dragListeners, dragAttributes, index, onActiveFileChange, onActiveTabChange, onCloseAllFiles, onCloseFile, onCloseFilesToRight, onCloseOtherFiles, path, preview, tabCount }) {
|
|
@@ -14455,65 +14637,6 @@ function GitPanelToolbar({ viewerContextId, cwd, active }) {
|
|
|
14455
14637
|
]
|
|
14456
14638
|
});
|
|
14457
14639
|
}
|
|
14458
|
-
var toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
14459
|
-
variants: {
|
|
14460
|
-
variant: {
|
|
14461
|
-
default: "bg-transparent",
|
|
14462
|
-
outline: "border border-input bg-transparent hover:bg-muted"
|
|
14463
|
-
},
|
|
14464
|
-
size: {
|
|
14465
|
-
default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
14466
|
-
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
14467
|
-
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"
|
|
14468
|
-
}
|
|
14469
|
-
},
|
|
14470
|
-
defaultVariants: {
|
|
14471
|
-
variant: "default",
|
|
14472
|
-
size: "default"
|
|
14473
|
-
}
|
|
14474
|
-
});
|
|
14475
|
-
var ToggleGroupContext = import_react.createContext({
|
|
14476
|
-
size: "default",
|
|
14477
|
-
variant: "default",
|
|
14478
|
-
spacing: 0,
|
|
14479
|
-
orientation: "horizontal"
|
|
14480
|
-
});
|
|
14481
|
-
function ToggleGroup$1({ className, variant, size, spacing = 0, orientation = "horizontal", children, ...props }) {
|
|
14482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, {
|
|
14483
|
-
"data-slot": "toggle-group",
|
|
14484
|
-
"data-variant": variant,
|
|
14485
|
-
"data-size": size,
|
|
14486
|
-
"data-spacing": spacing,
|
|
14487
|
-
"data-orientation": orientation,
|
|
14488
|
-
style: { "--gap": spacing },
|
|
14489
|
-
className: cn("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch", className),
|
|
14490
|
-
...props,
|
|
14491
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupContext.Provider, {
|
|
14492
|
-
value: {
|
|
14493
|
-
variant,
|
|
14494
|
-
size,
|
|
14495
|
-
spacing,
|
|
14496
|
-
orientation
|
|
14497
|
-
},
|
|
14498
|
-
children
|
|
14499
|
-
})
|
|
14500
|
-
});
|
|
14501
|
-
}
|
|
14502
|
-
function ToggleGroupItem({ className, children, variant = "default", size = "default", ...props }) {
|
|
14503
|
-
const context = import_react.useContext(ToggleGroupContext);
|
|
14504
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Toggle, {
|
|
14505
|
-
"data-slot": "toggle-group-item",
|
|
14506
|
-
"data-variant": context.variant || variant,
|
|
14507
|
-
"data-size": context.size || size,
|
|
14508
|
-
"data-spacing": context.spacing,
|
|
14509
|
-
className: cn("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", toggleVariants({
|
|
14510
|
-
variant: context.variant || variant,
|
|
14511
|
-
size: context.size || size
|
|
14512
|
-
}), className),
|
|
14513
|
-
...props,
|
|
14514
|
-
children
|
|
14515
|
-
});
|
|
14516
|
-
}
|
|
14517
14640
|
function GitSection({ title, meta, controls, className, bodyClassName, children }) {
|
|
14518
14641
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
14519
14642
|
className: cn("overflow-hidden rounded-xl border border-border/80 bg-card/50", className),
|
|
@@ -15316,7 +15439,17 @@ function FileReviewContent({ viewerContextId, cwd, active, onOpenFile }) {
|
|
|
15316
15439
|
})
|
|
15317
15440
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
15318
15441
|
className: "flex shrink-0 items-center gap-2",
|
|
15319
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
15442
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
|
|
15443
|
+
title: hasOpenFile ? "Collapse all" : "Expand all",
|
|
15444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
15445
|
+
variant: "outline",
|
|
15446
|
+
size: "icon",
|
|
15447
|
+
"aria-label": hasOpenFile ? "Collapse all" : "Expand all",
|
|
15448
|
+
disabled: changedFiles.length === 0,
|
|
15449
|
+
onClick: toggleAll,
|
|
15450
|
+
children: hasOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronsDownUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronsUpDown, { className: "size-4" })
|
|
15451
|
+
})
|
|
15452
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup$1, {
|
|
15320
15453
|
variant: "outline",
|
|
15321
15454
|
value: [diffStyle],
|
|
15322
15455
|
onValueChange: (values) => {
|
|
@@ -15327,11 +15460,6 @@ function FileReviewContent({ viewerContextId, cwd, active, onOpenFile }) {
|
|
|
15327
15460
|
value,
|
|
15328
15461
|
children: value === "unified" ? "Unified" : "Split"
|
|
15329
15462
|
}, value))
|
|
15330
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
|
|
15331
|
-
variant: "outline",
|
|
15332
|
-
disabled: changedFiles.length === 0,
|
|
15333
|
-
onClick: toggleAll,
|
|
15334
|
-
children: [hasOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronsDownUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronsUpDown, { className: "size-4" }), hasOpenFile ? "Collapse all" : "Expand all"]
|
|
15335
15463
|
})]
|
|
15336
15464
|
})]
|
|
15337
15465
|
}),
|
|
@@ -15501,21 +15629,18 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffStyle, file
|
|
|
15501
15629
|
className: "pointer-events-none hidden size-4 shrink-0 group-aria-expanded/review-file-trigger:inline"
|
|
15502
15630
|
})
|
|
15503
15631
|
]
|
|
15504
|
-
}), onOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
15632
|
+
}), onOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
15633
|
+
type: "button",
|
|
15634
|
+
variant: "ghost",
|
|
15635
|
+
size: "icon-xs",
|
|
15636
|
+
"aria-label": `Open ${file.path}`,
|
|
15505
15637
|
title: "Open file",
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
className: "mr-2 self-center",
|
|
15513
|
-
onClick: (event) => {
|
|
15514
|
-
event.stopPropagation();
|
|
15515
|
-
onOpenFile(file.path, { pin: true });
|
|
15516
|
-
},
|
|
15517
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SquareArrowOutUpRight, { className: "size-3.5" })
|
|
15518
|
-
})
|
|
15638
|
+
className: "mr-2 self-center",
|
|
15639
|
+
onClick: (event) => {
|
|
15640
|
+
event.stopPropagation();
|
|
15641
|
+
onOpenFile(file.path, { pin: true });
|
|
15642
|
+
},
|
|
15643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SquareArrowOutUpRight, { className: "size-3.5" })
|
|
15519
15644
|
}) : null]
|
|
15520
15645
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionContent, {
|
|
15521
15646
|
className: "bg-background p-0",
|