Merge branch 'feat/mothership-copilot' of github.com:simstudioai/sim into feat/mothership-copilot

This commit is contained in:
Vikhyath Mondreti
2026-03-09 18:03:49 -07:00
3 changed files with 147 additions and 2 deletions

View File

@@ -236,7 +236,8 @@ function TextEditor({
style={showPreview ? { width: `${splitPct}%`, flexShrink: 0 } : undefined}
className={cn(
'h-full resize-none border-0 bg-transparent p-[24px] font-mono text-[14px] text-[var(--text-body)] outline-none placeholder:text-[var(--text-subtle)]',
!showPreview && 'w-full'
!showPreview && 'w-full',
isResizing && 'pointer-events-none'
)}
/>
{showPreview && (
@@ -254,7 +255,9 @@ function TextEditor({
<div className='-translate-x-[0.5px] pointer-events-none absolute top-0 z-20 h-full w-[2px] bg-[var(--selection)]' />
)}
</div>
<div className='min-w-0 flex-1 overflow-hidden'>
<div
className={cn('min-w-0 flex-1 overflow-hidden', isResizing && 'pointer-events-none')}
>
<PreviewPanel content={content} mimeType={file.type} filename={file.name} />
</div>
</>

View File

@@ -139,6 +139,65 @@ export function VideoIcon(props: SVGProps<SVGSVGElement>) {
)
}
export function HtmlIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
viewBox='0 0 24 24'
fill='none'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
xmlns='http://www.w3.org/2000/svg'
{...props}
>
<path d='M8 8l-4 4 4 4' />
<path d='M16 8l4 4-4 4' />
<line x1='14' y1='4' x2='10' y2='20' />
</svg>
)
}
export function JsonIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
viewBox='0 0 24 24'
fill='none'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
xmlns='http://www.w3.org/2000/svg'
{...props}
>
<path d='M8 3H7a2 2 0 0 0-2 2v4c0 1.1-.9 2-2 2 1.1 0 2 .9 2 2v4a2 2 0 0 0 2 2h1' />
<path d='M16 3h1a2 2 0 0 1 2 2v4c0 1.1.9 2 2 2-1.1 0-2 .9-2 2v4a2 2 0 0 1-2 2h-1' />
</svg>
)
}
export function MarkdownIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' {...props}>
<rect x='2' y='4' width='20' height='16' rx='3' stroke='currentColor' strokeWidth='1.5' />
<path
d='M6 15V9l3 3.5L12 9v6'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
<path
d='M17 9v6m-2-2l2 2 2-2'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
</svg>
)
}
export function DefaultFileIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
@@ -218,5 +277,17 @@ export function getDocumentIcon(
return PptxIcon
}
if (mimeType === 'text/html' || extension === 'html' || extension === 'htm') {
return HtmlIcon
}
if (mimeType === 'application/json' || extension === 'json') {
return JsonIcon
}
if (mimeType === 'text/markdown' || extension === 'md' || extension === 'mdx') {
return MarkdownIcon
}
return DefaultFileIcon
}

View File

@@ -139,6 +139,65 @@ export function VideoIcon(props: SVGProps<SVGSVGElement>) {
)
}
export function HtmlIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
viewBox='0 0 24 24'
fill='none'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
xmlns='http://www.w3.org/2000/svg'
{...props}
>
<path d='M8 8l-4 4 4 4' />
<path d='M16 8l4 4-4 4' />
<line x1='14' y1='4' x2='10' y2='20' />
</svg>
)
}
export function JsonIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
viewBox='0 0 24 24'
fill='none'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
xmlns='http://www.w3.org/2000/svg'
{...props}
>
<path d='M8 3H7a2 2 0 0 0-2 2v4c0 1.1-.9 2-2 2 1.1 0 2 .9 2 2v4a2 2 0 0 0 2 2h1' />
<path d='M16 3h1a2 2 0 0 1 2 2v4c0 1.1.9 2 2 2-1.1 0-2 .9-2 2v4a2 2 0 0 1-2 2h-1' />
</svg>
)
}
export function MarkdownIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' {...props}>
<rect x='2' y='4' width='20' height='16' rx='3' stroke='currentColor' strokeWidth='1.5' />
<path
d='M6 15V9l3 3.5L12 9v6'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
<path
d='M17 9v6m-2-2l2 2 2-2'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
</svg>
)
}
export function DefaultFileIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
@@ -218,5 +277,17 @@ export function getDocumentIcon(
return PptxIcon
}
if (mimeType === 'text/html' || extension === 'html' || extension === 'htm') {
return HtmlIcon
}
if (mimeType === 'application/json' || extension === 'json') {
return JsonIcon
}
if (mimeType === 'text/markdown' || extension === 'md' || extension === 'mdx') {
return MarkdownIcon
}
return DefaultFileIcon
}