import * as react_jsx_runtime from 'react/jsx-runtime'; import { GitStatusEntry, ContextMenuItem, ContextMenuOpenContext, GitStatus } from '@pierre/trees'; import { ReactNode, CSSProperties } from 'react'; import { b as DocumentEditorMode, D as DocumentEditorBackend, d as DocumentEditorPaneCollaborationConfig } from './document-editor-pane-IAEQn_Dl.js'; import { a as ArtifactPaneProps } from './artifact-pane-DpuWcAiF.js'; import '@hocuspocus/provider'; import 'yjs'; /** * FileTree — directory browser with file type icons. * * Renders a hierarchical file system view. Clicking a file * triggers onSelect with the full path. */ interface FileNode { name: string; path: string; type: "file" | "directory"; children?: FileNode[]; size?: number; mimeType?: string; } interface FileTreeProps { root: FileNode; selectedPath?: string; onSelect?: (path: string, node: FileNode) => void; className?: string; defaultExpanded?: boolean; visibility?: FileTreeVisibilityOptions; } interface FileTreeVisibilityOptions { hiddenPaths?: string[]; hiddenPathPrefixes?: string[]; isVisible?: (node: FileNode) => boolean; } declare function filterFileTree(root: FileNode, visibility?: FileTreeVisibilityOptions): FileNode | null; declare function FileTree({ root, selectedPath, onSelect, className, defaultExpanded, visibility, }: FileTreeProps): react_jsx_runtime.JSX.Element | null; /** * Re-export Pierre's git-status union under a stable name so consumers * don't import directly from the dep. If we ever swap the underlying * implementation, only this file changes. */ type RichFileTreeGitStatus = GitStatus; type RichFileTreeGitEntry = GitStatusEntry; interface RichFileTreeProps { /** * Either a recursive `FileNode` tree (matches the existing FileTree * input) or a flat list of canonical paths. Pass exactly one. */ root?: FileNode; paths?: ReadonlyArray; /** Currently-selected path. Pierre supports multi-select internally; the * wrapper exposes a single string for parity with FileTree. */ selectedPath?: string; /** Called whenever the selection changes (single-select fan-out). */ onSelect?: (path: string) => void; /** Show the inline search input. Defaults to true. */ search?: boolean; /** Open / closed initial expansion. Defaults to "open" — match FileTree. */ initialExpansion?: "open" | "closed"; /** Optional git-status decorations per path. */ gitStatus?: ReadonlyArray; /** * Right-click / button-lane menu content. Receives the row and the * trigger context (which interaction opened the menu). */ renderContextMenu?: (item: ContextMenuItem, context: ContextMenuOpenContext) => ReactNode; /** Optional header rendered above the tree rows. */ header?: ReactNode; /** * Theme override map for shadow-DOM CSS variables. Most consumers can * leave this — defaults derive from the host element's computed * tokens via `cssVarFromToken()`. */ themeOverrides?: Partial; className?: string; style?: CSSProperties; /** Inline height (or set via `style.height`). Defaults to 100% of parent. */ height?: number | string; } interface RichFileTreeThemeVars { /** Selected-row background. */ selectedBg: string; /** Selected-row foreground. */ selectedFg: string; /** Default row foreground. */ fg: string; /** Hover background. */ hoverBg: string; /** Border / divider color. */ border: string; /** Muted (parent path, breadcrumb) foreground. */ mutedFg: string; } declare function RichFileTree({ root, paths, selectedPath, onSelect, search, initialExpansion, gitStatus, renderContextMenu, header, themeOverrides, className, style, height, }: RichFileTreeProps): react_jsx_runtime.JSX.Element; /** * FilePreview — universal file renderer. * * Renders any file type beautifully: * - PDF: embedded viewer * - CSV/XLSX: tabular preview * - Code (py/json/yaml/ts/js): syntax-highlighted, line-numbered viewer * - Markdown: rendered prose * - Images: inline display * - Text: monospace preview */ interface FilePreviewProps { filename: string; content?: string; blobUrl?: string; mimeType?: string; onClose?: () => void; onDownload?: () => void; hideHeader?: boolean; className?: string; } declare function FilePreview({ filename, content, blobUrl, mimeType, onClose, onDownload, hideHeader, className, }: FilePreviewProps): react_jsx_runtime.JSX.Element; /** * FileTabs — tab bar for open files in the preview panel. */ interface FileTabData { id: string; name: string; path: string; dirty?: boolean; } interface FileTabsProps { tabs: FileTabData[]; activeId?: string; onSelect: (id: string) => void; onClose: (id: string) => void; className?: string; } declare function FileTabs({ tabs, activeId, onSelect, onClose, className }: FileTabsProps): react_jsx_runtime.JSX.Element | null; interface FileArtifactPaneEditorOptions { enabled?: boolean; mode?: DocumentEditorMode; defaultMode?: DocumentEditorMode; onModeChange?: (mode: DocumentEditorMode) => void; backend?: DocumentEditorBackend; collaboration?: DocumentEditorPaneCollaborationConfig; placeholder?: string; autoFocus?: boolean; readOnly?: boolean; saving?: boolean; saveLabel?: string; onChange?: (markdown: string) => void; onSave?: (markdown: string) => Promise | void; previewClassName?: string; editorClassName?: string; } interface FileArtifactPaneProps extends Omit { path?: string; tabs?: FileTabData[]; activeTabId?: string; onTabSelect?: (id: string) => void; onTabClose?: (id: string) => void; eyebrow?: ArtifactPaneProps["eyebrow"]; meta?: ArtifactPaneProps["meta"]; toolbar?: ArtifactPaneProps["toolbar"]; footer?: ArtifactPaneProps["footer"]; className?: string; headerClassName?: ArtifactPaneProps["headerClassName"]; hideTitleBlock?: ArtifactPaneProps["hideTitleBlock"]; editor?: FileArtifactPaneEditorOptions; } /** * FileArtifactPane — opinionated artifact frame for file previews with tabs and * header actions. */ declare function FileArtifactPane({ filename, content, blobUrl, mimeType, onClose, onDownload, path, tabs, activeTabId, onTabSelect, onTabClose, eyebrow, meta, toolbar, footer, className, headerClassName, hideTitleBlock, editor, }: FileArtifactPaneProps): react_jsx_runtime.JSX.Element; /** * Shared file-format detection for every file surface — the preview pane, the * artifact pane, and code rendering. Centralising extension/MIME → format logic * keeps chat and artifact views consistent and avoids the same mapping drifting * across components. */ type FileFormat = "pdf" | "image" | "csv" | "spreadsheet" | "code" | "json" | "yaml" | "markdown" | "text" | "unknown"; /** * Lowercased trailing extension. Returns "" for a name with no extension * ("README", "json" → ""), and the post-dot name for a dotfile (".bashrc" → * "bashrc"). Directory components are ignored so dots in a directory name don't * leak in ("my.config/file" → ""). */ declare function fileExtension(filename: string): string; /** * Resolve a filename + optional MIME type to the renderer format. A specific, * authoritative MIME type wins over the extension; otherwise the extension * decides; a generic text/plain payload is the final fallback. */ declare function detectFileFormat(filename: string, mimeType?: string): FileFormat; /** Human-facing label for a detected format. */ declare function getFormatLabel(format: FileFormat): string; /** * Map a filename (or path) to a highlight.js language id for CodeBlock. Returns * undefined when there is no confident mapping; CodeBlock then renders themed * monospace and lets the highlighter auto-detect, so callers never need a * bespoke language table. */ declare function getSyntaxLanguage(filename: string): string | undefined; /** * Highlight language for a file already classified as a code-like format. * `json`/`yaml` are their own highlight language even when detected purely from * a MIME type on an extensionless file (where the extension can't reveal it); * any other code format keys off the extension. */ declare function getCodeLanguage(filename: string, format: FileFormat): string | undefined; export { FileArtifactPane, type FileArtifactPaneProps, type FileFormat, type FileNode, FilePreview, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, detectFileFormat, fileExtension, filterFileTree, getCodeLanguage, getFormatLabel, getSyntaxLanguage };