feat(editor): add block meta for table block (#10915)

This commit is contained in:
Saul-Mirone
2025-03-17 05:20:10 +00:00
parent 6eb34d70c1
commit 808c053c3c
3 changed files with 20 additions and 3 deletions

View File

@@ -6,6 +6,8 @@ import {
defineBlockSchema,
} from '@blocksuite/store';
import type { BlockMeta } from '../../utils/types';
export type TableCell = {
text: Text;
};
@@ -23,7 +25,7 @@ export interface TableColumn {
width?: number;
}
export interface TableBlockProps {
export interface TableBlockProps extends BlockMeta {
rows: Record<string, TableRow>;
columns: Record<string, TableColumn>;
// key = `${rowId}:${columnId}`
@@ -50,6 +52,10 @@ export const TableBlockSchema = defineBlockSchema({
rows: {},
columns: {},
cells: {},
'meta:createdAt': undefined,
'meta:createdBy': undefined,
'meta:updatedAt': undefined,
'meta:updatedBy': undefined,
}),
metadata: {
isFlatData: true,