feat: add sheet block (#743)
Co-authored-by: Nicolas <nicolascamara29@gmail.com>
This commit is contained in:
parent
93b02a85e1
commit
76804269c4
14 changed files with 419 additions and 6 deletions
|
|
@ -19,6 +19,7 @@ import { DocumentToolCall, DocumentToolResult } from './document';
|
|||
import { CodeEditor } from './code-editor';
|
||||
import { useBlock } from '@/hooks/use-block';
|
||||
import equal from 'fast-deep-equal';
|
||||
import { SpreadsheetEditor } from './sheet-editor';
|
||||
import { ImageEditor } from './image-editor';
|
||||
|
||||
interface DocumentPreviewProps {
|
||||
|
|
@ -43,6 +44,7 @@ export function DocumentPreview({
|
|||
|
||||
useEffect(() => {
|
||||
const boundingBox = hitboxRef.current?.getBoundingClientRect();
|
||||
|
||||
if (block.documentId && boundingBox) {
|
||||
setBlock((block) => ({
|
||||
...block,
|
||||
|
|
@ -256,6 +258,12 @@ const DocumentContent = ({ document }: { document: Document }) => {
|
|||
<CodeEditor {...commonProps} onSaveContent={() => {}} />
|
||||
</div>
|
||||
</div>
|
||||
) : document.kind === 'sheet' ? (
|
||||
<div className="flex flex-1 relative size-full p-4">
|
||||
<div className="absolute inset-0">
|
||||
<SpreadsheetEditor {...commonProps} />
|
||||
</div>
|
||||
</div>
|
||||
) : document.kind === 'image' ? (
|
||||
<ImageEditor
|
||||
title={document.title}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue