feat(editor): improve api for store, and add docs (#10941)

This commit is contained in:
Saul-Mirone
2025-03-17 16:30:59 +00:00
parent b0aa2c90fd
commit 3de7d85eea
47 changed files with 1212 additions and 210 deletions

View File

@@ -27,7 +27,7 @@ export const database: InitFn = (collection: Workspace, id: string) => {
// Add note block inside root block
const noteId = doc.addBlock('affine:note', {}, rootId);
const pId = doc.addBlock('affine:paragraph', {}, noteId);
const model = doc.getBlockById(pId);
const model = doc.getModelById(pId);
if (!model) {
throw new Error('model is not found');
}
@@ -40,7 +40,7 @@ export const database: InitFn = (collection: Workspace, id: string) => {
},
noteId
);
const database = doc.getBlockById(databaseId) as DatabaseBlockModel;
const database = doc.getModelById(databaseId) as DatabaseBlockModel;
const datasource = new DatabaseBlockDataSource(database);
datasource.viewManager.viewAdd('table');
database.props.title = new Text(title);