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
@@ -129,7 +129,7 @@ export class EdgelessCRUDExtension extends Extension {
return;
}
const block = this.std.store.getBlockById(id);
const block = this.std.store.getModelById(id);
if (block) {
const key = getLastPropsKey(block.flavour, {
...block.yBlock.toJSON(),
@@ -145,7 +145,7 @@ export class EdgelessCRUDExtension extends Extension {
if (!surface) {
return null;
}
const el = surface.getElementById(id) ?? this.std.store.getBlockById(id);
const el = surface.getElementById(id) ?? this.std.store.getModelById(id);
return el as GfxModel | null;
}
@@ -602,7 +602,7 @@ function getNotesInFrameBound(
): NoteBlockModel[] {
const bound = Bound.deserialize(frame.xywh);
return (doc.getBlockByFlavour('affine:note') as NoteBlockModel[]).filter(
return (doc.getModelsByFlavour('affine:note') as NoteBlockModel[]).filter(
ele => {
const xywh = Bound.deserialize(ele.xywh);